Update virtual scroll when note scale is changed
This commit is contained in:
parent
94d5a97da3
commit
be1270c10e
|
@ -14,6 +14,7 @@
|
||||||
let notesOffset = 0;
|
let notesOffset = 0;
|
||||||
let notesLimit = 100;
|
let notesLimit = 100;
|
||||||
let prevNotesCount = 0;
|
let prevNotesCount = 0;
|
||||||
|
let prevRowHeight = 0;
|
||||||
|
|
||||||
const { noteScale } = settings;
|
const { noteScale } = settings;
|
||||||
let scaleUnsubscribe: Unsubscriber;
|
let scaleUnsubscribe: Unsubscriber;
|
||||||
|
@ -36,11 +37,19 @@
|
||||||
Math.min(notesCount - offset, Math.ceil(windowHeight / rowHeight) + paddingRows * 2) *
|
Math.min(notesCount - offset, Math.ceil(windowHeight / rowHeight) + paddingRows * 2) *
|
||||||
columnCount;
|
columnCount;
|
||||||
|
|
||||||
if (offset === notesOffset && limit === notesLimit && notesCount === prevNotesCount) return;
|
if (
|
||||||
|
offset === notesOffset &&
|
||||||
|
limit === notesLimit &&
|
||||||
|
notesCount === prevNotesCount &&
|
||||||
|
rowHeight === prevRowHeight
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
notesOffset = offset;
|
notesOffset = offset;
|
||||||
notesLimit = limit;
|
notesLimit = limit;
|
||||||
prevNotesCount = notesCount;
|
prevNotesCount = notesCount;
|
||||||
|
prevRowHeight = rowHeight;
|
||||||
|
|
||||||
await notes.setPage(offset, limit);
|
await notes.setPage(offset, limit);
|
||||||
scrollHeight = Math.max(0, fullHeight);
|
scrollHeight = Math.max(0, fullHeight);
|
||||||
|
|
Loading…
Reference in New Issue