Skip to content

Commit

Permalink
feat: add hideThrottleDragRotateLine prop #923
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Jun 2, 2023
1 parent 589bb9d commit e091d39
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/react-moveable/src/ables/Draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default {
"draggable",
"throttleDrag",
"throttleDragRotate",
"hideThrottleDragRotateLine",
"startDragRotate",
"edgeDraggable",
] as const,
Expand All @@ -53,10 +54,10 @@ export default {
moveable: MoveableManagerInterface<DraggableProps, DraggableState>,
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;
Expand Down
5 changes: 5 additions & 0 deletions packages/react-moveable/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e091d39

Please sign in to comment.