Vanessa 2025-11-28 21:32:07 +08:00
parent c70e3f46ec
commit 9f0eaa6a0b
3 changed files with 9 additions and 6 deletions

View file

@ -30,6 +30,7 @@ const dragoverScroll: {
space?: number // -1 向上1 向下
lastTime?: number
} = {};
export const stopScrollAnimation = () => {
if (dragoverScroll.animationId) {
cancelAnimationFrame(dragoverScroll.animationId);
@ -39,6 +40,7 @@ export const stopScrollAnimation = () => {
dragoverScroll.lastTime = null;
}
};
const scrollAnimation = (timestamp: number) => {
if (!dragoverScroll.lastTime) {
dragoverScroll.lastTime = timestamp - 8;