From ee899cea2d91bbe55f3869e8c0ad836a9e6ad6d5 Mon Sep 17 00:00:00 2001 From: Joeri Exelmans Date: Thu, 13 Nov 2025 21:01:50 +0100 Subject: [PATCH] fix selection --- src/App/VisualEditor/hooks/useMouse.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/App/VisualEditor/hooks/useMouse.tsx b/src/App/VisualEditor/hooks/useMouse.tsx index a49f8db..54b198a 100644 --- a/src/App/VisualEditor/hooks/useMouse.tsx +++ b/src/App/VisualEditor/hooks/useMouse.tsx @@ -271,16 +271,16 @@ export function useMouse(makeCheckPoint: () => void, insertMode: InsertMode, zoo // @ts-ignore setSelection(oldSelection => { - const newSelection = []; + const newSelection = [...oldSelection]; const common = []; for (const shape of shapesInSelection) { const uid = shape.dataset.uid; if (uid) { const parts = shape.dataset.parts?.split(' ') || []; for (const part of parts) { - if (oldSelection.some(({uid: oldUid, part: oldPart}) => + if (newSelection.some(({uid: oldUid, part: oldPart}) => uid === oldUid && part === oldPart)) { - common.push({uid, part}); + // common.push({uid, part}); } else { @@ -289,7 +289,9 @@ export function useMouse(makeCheckPoint: () => void, insertMode: InsertMode, zoo } } } - return [...oldSelection, ...newSelection]; + // console.log({newSelection, oldSelection, common}); + // return [...oldSelection, ...newSelection]; + return newSelection;xxxxxxxx }) } }