Skip to content

Commit

Permalink
fix: fix roundable shadow condition
Browse files Browse the repository at this point in the history
  • Loading branch information
daybrush committed Sep 12, 2023
1 parent 266872c commit adb09b7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/moveable/test/manual/resizable.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
resizable: true,
scalable: false,
rotatable: true,
roundable: true,
isDisplayShadowRoundControls: true,
maxRoundControls: [4, 0],
roundPadding: 20,
isDisplaySnapDigit: false,
elementGuidelines: [document.body],
snappable: true,
Expand Down
6 changes: 4 additions & 2 deletions packages/react-moveable/src/ables/Roundable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,11 @@ cursor: pointer;
originalPos[0] += roundPadding;
}
const pos = minus(calculatePosition(allMatrix, originalPos, n), basePos);

const isDisplayVerticalShadow
= isDisplayShadowRoundControls
&& isDisplayShadowRoundControls !== "horizontal";
const isDisplay = v.vertical
? verticalCount <= maxRoundControls[1] && (isDisplayShadowRoundControls || !v.virtual)
? verticalCount <= maxRoundControls[1] && (isDisplayVerticalShadow || !v.virtual)
: horizontalCount <= maxRoundControls[0] && (isDisplayShadowRoundControls || !v.virtual);

return <div key={`borderRadiusControl${i}`}
Expand Down

0 comments on commit adb09b7

Please sign in to comment.