magnet harder
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user