Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Fix initially hidden large items spanning the whole visible range (extended by 25% to the … #157

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion lib/timeline/component/Group.js
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,20 @@ class Group {
return visibleItems;
}

const interval = (range.end - range.start) / 4;
const rangeDuration = range.end - range.start;
let interval = rangeDuration / 4;

for (let i = 0; i < orderedItems.byEnd.length; i++) {
const item = orderedItems.byEnd[i];

const duration = item.data.end - item.data.start;
const maxProtruding = duration - rangeDuration;

if (maxProtruding > interval) {
interval = maxProtruding;
}
}

const lowerBound = range.start - interval;
const upperBound = range.end + interval;

Expand Down