Skip to content

Commit

Permalink
fix: fix names
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Dec 3, 2023
1 parent 9054be0 commit 7722add
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 6 additions & 2 deletions packages/react-moveable/src/ables/Snappable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ import {
getSnapBoundInfo,
} from "./snappable/snapBounds";
import { getTotalGuidelines } from "./snappable/getTotalGuidelines";
import {
NAME_snapRotationThreshold, NAME_snapRotationDegrees,
NAME_snapHorizontalThreshold, NAME_snapVerticalThreshold,
} from "./snappable/names";


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


const NAME_snapRotationThreshold = "snapRotationThreshold";
const NAME_snapRotationDegrees = "snapRotationDegrees";

/**
* @namespace Moveable.Snappable
Expand All @@ -638,6 +640,8 @@ export default {
"snapGridAll",
NAME_snapRotationThreshold,
NAME_snapRotationDegrees,
NAME_snapHorizontalThreshold,
NAME_snapVerticalThreshold,
"horizontalGuidelines",
"verticalGuidelines",
"elementGuidelines",
Expand Down
4 changes: 4 additions & 0 deletions packages/react-moveable/src/ables/snappable/names.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export const NAME_snapRotationThreshold = "snapRotationThreshold";
export const NAME_snapRotationDegrees = "snapRotationDegrees";
export const NAME_snapHorizontalThreshold = "snapHorizontalThreshold";
export const NAME_snapVerticalThreshold = "snapVerticalThreshold";
5 changes: 3 additions & 2 deletions packages/react-moveable/src/ables/snappable/snap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { getPosByDirection, getPosesByDirection } from "../../gesto/GestoUtils";
import { TINY_NUM } from "../../consts";
import { minus } from "@scena/matrix";
import { splitSnapDirectionPoses } from "./utils";
import { NAME_snapHorizontalThreshold, NAME_snapVerticalThreshold } from "./names";



Expand All @@ -26,12 +27,12 @@ export function checkMoveableSnapPoses(
const snapThresholdMultiples = moveable.state.snapThresholdInfo?.multiples || [1, 1];
const snapHorizontalThreshold = selectValue<number>(
customSnapHorizontalThreshold,
props.snapHorizontalThreshold,
props[NAME_snapHorizontalThreshold],
5,
);
const snapVerticalThreshold = selectValue<number>(
customSnapVerticalThreshold,
props.snapVerticalThreshold,
props[NAME_snapVerticalThreshold],
5,
);

Expand Down

0 comments on commit 7722add

Please sign in to comment.