fix status index approxmiation in timeline rendering for dynamically changing viewport geometries
This commit is contained in:
parent
92e8190f63
commit
58fdd50838
2 changed files with 5 additions and 1 deletions
1
changelog.d/timeline_rendering_status_index_approx.fix
Normal file
1
changelog.d/timeline_rendering_status_index_approx.fix
Normal file
|
|
@ -0,0 +1 @@
|
|||
Fixed status index approxmiation in timeline rendering for dynamically changing viewport geometries
|
||||
|
|
@ -263,7 +263,10 @@ const Timeline = {
|
|||
|
||||
// Start from approximating the index of some visible status by using the
|
||||
// the center of the screen on the timeline.
|
||||
let approxIndex = Math.floor(statuses.length * (centerOfScreen / height))
|
||||
let approxIndex = Math.min(
|
||||
Math.floor(statuses.length * (centerOfScreen / height)),
|
||||
statuses.length - 1,
|
||||
)
|
||||
let err = statuses[approxIndex].getBoundingClientRect().y
|
||||
|
||||
// if we have a previous scroll index that can be used, test if it's
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue