scroller: always adjust all ticks

old-stable24
Varun Patil 2022-10-15 22:48:25 -07:00
parent 37d9307bab
commit c758c69c93
2 changed files with 5 additions and 10 deletions

View File

@ -257,8 +257,8 @@ export default class ScrollerManager extends Mixins(GlobalMixin) {
// Start with the first tick. Walk over all rows counting the
// y position. When you hit a row with the tick, update y and
// top values and move to the next visible tick.
let tickId = 0; // regardless of whether it's visible or not
// top values and move to the next tick.
let tickId = 0;
let y = 0;
for (const row of this.rows) {
@ -272,12 +272,7 @@ export default class ScrollerManager extends Mixins(GlobalMixin) {
if (tick.dayId === row.dayId) {
tick.y = y;
this.setTickTop(tick);
// Get the next visible tick
tickId++;
while (tickId < this.ticks.length && !this.ticks[tickId].s) {
tickId++;
}
}
y += row.size;

View File

@ -771,11 +771,11 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
// So just reflow the timeline here
if (rowSizeDelta !== 0) {
if (headRemoved) {
// If the head was removed, that warrants a reflow
// since months or years might disappear!
// If the head was removed, we need a reflow,
// or adjust isn't going to work right
this.scrollerManager.reflow();
} else {
// Otherwise just adjust the visible ticks
// Otherwise just adjust the ticks
this.scrollerManager.adjust();
}