Skip to content

Commit 7722add

Browse files
committed
fix: fix names
1 parent 9054be0 commit 7722add

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

packages/react-moveable/src/ables/Snappable.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ import {
7272
getSnapBoundInfo,
7373
} from "./snappable/snapBounds";
7474
import { getTotalGuidelines } from "./snappable/getTotalGuidelines";
75+
import {
76+
NAME_snapRotationThreshold, NAME_snapRotationDegrees,
77+
NAME_snapHorizontalThreshold, NAME_snapVerticalThreshold,
78+
} from "./snappable/names";
7579

7680

7781
export interface SnapPoses {
@@ -610,8 +614,6 @@ function addBoundGuidelines(
610614
const directionCondition = getDirectionCondition("", ["resizable", "scalable"]);
611615

612616

613-
const NAME_snapRotationThreshold = "snapRotationThreshold";
614-
const NAME_snapRotationDegrees = "snapRotationDegrees";
615617

616618
/**
617619
* @namespace Moveable.Snappable
@@ -638,6 +640,8 @@ export default {
638640
"snapGridAll",
639641
NAME_snapRotationThreshold,
640642
NAME_snapRotationDegrees,
643+
NAME_snapHorizontalThreshold,
644+
NAME_snapVerticalThreshold,
641645
"horizontalGuidelines",
642646
"verticalGuidelines",
643647
"elementGuidelines",
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const NAME_snapRotationThreshold = "snapRotationThreshold";
2+
export const NAME_snapRotationDegrees = "snapRotationDegrees";
3+
export const NAME_snapHorizontalThreshold = "snapHorizontalThreshold";
4+
export const NAME_snapVerticalThreshold = "snapVerticalThreshold";

packages/react-moveable/src/ables/snappable/snap.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { getPosByDirection, getPosesByDirection } from "../../gesto/GestoUtils";
1010
import { TINY_NUM } from "../../consts";
1111
import { minus } from "@scena/matrix";
1212
import { splitSnapDirectionPoses } from "./utils";
13+
import { NAME_snapHorizontalThreshold, NAME_snapVerticalThreshold } from "./names";
1314

1415

1516

@@ -26,12 +27,12 @@ export function checkMoveableSnapPoses(
2627
const snapThresholdMultiples = moveable.state.snapThresholdInfo?.multiples || [1, 1];
2728
const snapHorizontalThreshold = selectValue<number>(
2829
customSnapHorizontalThreshold,
29-
props.snapHorizontalThreshold,
30+
props[NAME_snapHorizontalThreshold],
3031
5,
3132
);
3233
const snapVerticalThreshold = selectValue<number>(
3334
customSnapVerticalThreshold,
34-
props.snapVerticalThreshold,
35+
props[NAME_snapVerticalThreshold],
3536
5,
3637
);
3738

0 commit comments

Comments
 (0)