From e091d396f2436ef0ad8d8dfa8922dcd86ec08bfd Mon Sep 17 00:00:00 2001 From: Daybrush Date: Sat, 3 Jun 2023 02:55:16 +0900 Subject: [PATCH] feat: add hideThrottleDragRotateLine prop #923 --- packages/react-moveable/src/ables/Draggable.tsx | 5 +++-- packages/react-moveable/src/types.ts | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/react-moveable/src/ables/Draggable.tsx b/packages/react-moveable/src/ables/Draggable.tsx index f8c9d3cdf..a904cd2bb 100644 --- a/packages/react-moveable/src/ables/Draggable.tsx +++ b/packages/react-moveable/src/ables/Draggable.tsx @@ -32,6 +32,7 @@ export default { "draggable", "throttleDrag", "throttleDragRotate", + "hideThrottleDragRotateLine", "startDragRotate", "edgeDraggable", ] as const, @@ -53,10 +54,10 @@ export default { moveable: MoveableManagerInterface, React: Renderer, ): any[] { - const { throttleDragRotate, zoom } = moveable.props; + const { hideThrottleDragRotateLine, throttleDragRotate, zoom } = moveable.props; const { dragInfo, beforeOrigin } = moveable.getState(); - if (!throttleDragRotate || !dragInfo) { + if (hideThrottleDragRotateLine || !throttleDragRotate || !dragInfo) { return []; } const dist = dragInfo.dist; diff --git a/packages/react-moveable/src/types.ts b/packages/react-moveable/src/types.ts index d711a4717..9c3456151 100644 --- a/packages/react-moveable/src/types.ts +++ b/packages/react-moveable/src/types.ts @@ -1902,6 +1902,11 @@ export interface DraggableOptions { * @default 0 */ throttleDragRotate?: number; + /** + * Hides the guidelines that appear when using the `throttleDragRotate` prop. + * @default false + */ + hideThrottleDragRotateLine?: boolean; /** * start angle(degree) of x,y for throttleDragRotate when drag. * @default 0