From 521dabe17afe59a95f5c7f6762a6158e009ed9b0 Mon Sep 17 00:00:00 2001 From: christian Date: Sun, 3 Nov 2024 22:41:10 +0100 Subject: [PATCH] suspense not needed --- app/routes/CropSelector.tsx | 44 ++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/app/routes/CropSelector.tsx b/app/routes/CropSelector.tsx index 12c3325..46efbe4 100644 --- a/app/routes/CropSelector.tsx +++ b/app/routes/CropSelector.tsx @@ -40,38 +40,36 @@ export default function CropSelector() { const deltaX = newPosition.x - selectorPosition.x; const deltaY = newPosition.y - selectorPosition.y; - setFirstDragable(prev => ({ + setFirstDragable({ x: Math.min(firstDragable.x, secondDragable.x) + deltaX, y: Math.min(firstDragable.y, secondDragable.y) + deltaY - })); + }); - setSecondDragable(prev => ({ + setSecondDragable({ x: Math.max(firstDragable.x, secondDragable.x) + deltaX, y: Math.max(firstDragable.y, secondDragable.y) + deltaY - })); + }); }; return (
- Loading...

}> -
- - - - - - - -
-
+
+ + + + + + + +
); }