Use ceil for numCols heuristic

cache
Varun Patil 2022-10-16 09:58:46 -07:00
parent 0109eca86d
commit 7c553064b7
1 changed files with 2 additions and 1 deletions

View File

@ -299,7 +299,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
} else { } else {
// As a heuristic, assume all images are 4:3 landscape // As a heuristic, assume all images are 4:3 landscape
this.rowHeight = DESKTOP_ROW_HEIGHT; this.rowHeight = DESKTOP_ROW_HEIGHT;
this.numCols = Math.floor(this.rowWidth / (this.rowHeight * 4 / 3)); this.numCols = Math.ceil(this.rowWidth / (this.rowHeight * 4 / 3));
} }
} }
@ -777,6 +777,7 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) {
} else { } else {
// Otherwise just adjust the ticks // Otherwise just adjust the ticks
this.scrollerManager.adjust(); this.scrollerManager.adjust();
console.log('adjust', rowSizeDelta, addedRows.length + removedRows.length, day);
} }
// Scroll to the same actual position if the added rows // Scroll to the same actual position if the added rows