Flip animation fix
This commit is contained in:
parent
7342c18c00
commit
73551c5596
|
@ -11,13 +11,15 @@
|
||||||
const paddingRows = 2;
|
const paddingRows = 2;
|
||||||
let scrollHeight = 0;
|
let scrollHeight = 0;
|
||||||
let scrollOffset = 0;
|
let scrollOffset = 0;
|
||||||
let flipDuration = 0;
|
|
||||||
|
|
||||||
let notesOffset = 0;
|
let notesOffset = 0;
|
||||||
let notesLimit = 100;
|
let notesLimit = 100;
|
||||||
let prevNotesCount = 0;
|
let prevNotesCount = 0;
|
||||||
let prevRowHeight = 0;
|
let prevRowHeight = 0;
|
||||||
|
|
||||||
|
let flipDuration = 0;
|
||||||
|
let flipTimeout: ReturnType<typeof setTimeout> | undefined;
|
||||||
|
|
||||||
const { noteScale } = settings;
|
const { noteScale } = settings;
|
||||||
let scaleUnsubscribe: Unsubscriber;
|
let scaleUnsubscribe: Unsubscriber;
|
||||||
let countUnsubscribe: Unsubscriber;
|
let countUnsubscribe: Unsubscriber;
|
||||||
|
@ -41,7 +43,8 @@
|
||||||
|
|
||||||
if (notesCount !== prevNotesCount) {
|
if (notesCount !== prevNotesCount) {
|
||||||
flipDuration = 300;
|
flipDuration = 300;
|
||||||
setTimeout(() => {
|
clearTimeout(flipTimeout);
|
||||||
|
flipTimeout = setTimeout(() => {
|
||||||
flipDuration = 0;
|
flipDuration = 0;
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue