diff --git a/src/pages/editor/components/canvas/useSnap.ts b/src/pages/editor/components/canvas/useSnap.ts index 8077d7f..c6d8619 100644 --- a/src/pages/editor/components/canvas/useSnap.ts +++ b/src/pages/editor/components/canvas/useSnap.ts @@ -4,7 +4,7 @@ export type Guide = { position: number; }; -const SNAP_THRESHOLD = 5; +const SNAP_THRESHOLD = 10; export type SnappedPositionResult = { position: { x: number; y: number }; @@ -22,7 +22,7 @@ export const getSnappedPosition = ( guides.forEach((guide) => { if ( guide.orientation === "vertical" && - Math.abs(pos.x - guide.position) < SNAP_THRESHOLD + Math.abs(pos.x - guide.position) <= SNAP_THRESHOLD ) { x = guide.position; activeGuideIds.push(guide.id); @@ -30,7 +30,7 @@ export const getSnappedPosition = ( if ( guide.orientation === "horizontal" && - Math.abs(pos.y - guide.position) < SNAP_THRESHOLD + Math.abs(pos.y - guide.position) <= SNAP_THRESHOLD ) { y = guide.position; activeGuideIds.push(guide.id);