fix selection rect not working at all

This commit is contained in:
2025-09-05 17:13:29 +02:00
parent 49c59cbaea
commit 8c4f56a7ab

View File

@@ -43,9 +43,8 @@ function onDocumentPointerUp(e: MouseEvent) {
return; return;
} }
rect.disable(); if (!rect.isMinSize()) {
warrenStore.clearSelection();
if (warrenStore.current == null || warrenStore.current.dir == null) {
return; return;
} }
@@ -53,14 +52,14 @@ function onDocumentPointerUp(e: MouseEvent) {
const top = Math.min(rect.a.y, rect.b.y); const top = Math.min(rect.a.y, rect.b.y);
const width = Math.abs(rect.a.x - rect.b.x); const width = Math.abs(rect.a.x - rect.b.x);
const height = Math.abs(rect.a.y - rect.b.y); const height = Math.abs(rect.a.y - rect.b.y);
const selectionRect = new DOMRect(left, top, width, height);
if (!rect.isMinSize()) { rect.disable();
warrenStore.clearSelection();
if (warrenStore.current == null || warrenStore.current.dir == null) {
return; return;
} }
const selectionRect = new DOMRect(left, top, width, height);
const entryElements = document.querySelectorAll('[data-entry-index]'); const entryElements = document.querySelectorAll('[data-entry-index]');
const targetEntries = []; const targetEntries = [];