From 8c4f56a7abc5cf75f3f59ae45422e46f565e69bf Mon Sep 17 00:00:00 2001 From: 409 <409dev@protonmail.com> Date: Fri, 5 Sep 2025 17:13:29 +0200 Subject: [PATCH] fix selection rect not working at all --- frontend/components/SelectionRect.vue | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/components/SelectionRect.vue b/frontend/components/SelectionRect.vue index 53ff10b..b1517bb 100644 --- a/frontend/components/SelectionRect.vue +++ b/frontend/components/SelectionRect.vue @@ -43,9 +43,8 @@ function onDocumentPointerUp(e: MouseEvent) { return; } - rect.disable(); - - if (warrenStore.current == null || warrenStore.current.dir == null) { + if (!rect.isMinSize()) { + warrenStore.clearSelection(); return; } @@ -53,14 +52,14 @@ function onDocumentPointerUp(e: MouseEvent) { const top = Math.min(rect.a.y, rect.b.y); const width = Math.abs(rect.a.x - rect.b.x); const height = Math.abs(rect.a.y - rect.b.y); + const selectionRect = new DOMRect(left, top, width, height); - if (!rect.isMinSize()) { - warrenStore.clearSelection(); + rect.disable(); + + if (warrenStore.current == null || warrenStore.current.dir == null) { return; } - const selectionRect = new DOMRect(left, top, width, height); - const entryElements = document.querySelectorAll('[data-entry-index]'); const targetEntries = [];