From 6bbf2945c24bf70002b41167dc89bf1dd4fde89c Mon Sep 17 00:00:00 2001 From: Julien Calixte Date: Sat, 22 Feb 2025 23:19:09 +0100 Subject: [PATCH] todo: fix wrong offset --- src/hooks/useNoteOverlay.hook.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hooks/useNoteOverlay.hook.ts b/src/hooks/useNoteOverlay.hook.ts index f6129e3..2f4061e 100644 --- a/src/hooks/useNoteOverlay.hook.ts +++ b/src/hooks/useNoteOverlay.hook.ts @@ -13,11 +13,15 @@ export const useNoteOverlay = ( const { x, y, isMobile } = useOverlay() const noteHeight = ref(0) + // TODO: it seems to have a wrong offset, + // visible when there are a lot of notes. const displayNoteOverlay = computed(() => { + const valueIndex = toValue(index) + if (isMobile.value) { - return y.value > toValue(index) * noteHeight.value + return y.value > valueIndex * noteHeight.value } else { - return x.value > toValue(index) * NOTE_WIDTH + return x.value > valueIndex * NOTE_WIDTH } })