Disabled rotation snapping if grid snapping disabled with shortcut

This commit is contained in:
Mitchell McCaffrey 2021-08-13 14:22:04 +10:00
parent 243b876a97
commit 54debeb61c

View File

@ -272,7 +272,11 @@ function Transformer({
onTransform={handleTrasform} onTransform={handleTrasform}
onTransformEnd={handleTransformEnd} onTransformEnd={handleTransformEnd}
centeredScaling={true} centeredScaling={true}
rotationSnaps={[...Array(24).keys()].map((n) => n * 15)} rotationSnaps={
snappingSensitivity === -1
? [] // Disabled rotation snapping if grid snapping disabled with shortcut
: [...Array(24).keys()].map((n) => n * 15)
}
rotateAnchorOffset={16} rotateAnchorOffset={16}
enabledAnchors={["middle-left", "middle-right"]} enabledAnchors={["middle-left", "middle-right"]}
flipEnabled={false} flipEnabled={false}