suspense not needed
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Successful in 28s
All checks were successful
Deploy to Cloudflare Pages / deploy (push) Successful in 28s
This commit is contained in:
parent
86ba372227
commit
521dabe17a
@ -40,20 +40,19 @@ 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 (
|
||||
<div className="flex flex-col h-screen w-screen justify-center items-center">
|
||||
<Suspense fallback={<p>Loading...</p>}>
|
||||
<div ref={containerRef} className="relative w-1/3 h-1/3 border-black border">
|
||||
<DragableBox
|
||||
position={selectorPosition}
|
||||
@ -71,7 +70,6 @@ export default function CropSelector() {
|
||||
<PhAngle />
|
||||
</DragableBox>
|
||||
</div>
|
||||
</Suspense>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user