-
Notifications
You must be signed in to change notification settings - Fork 11
Description
In the iOS photos app and Telegram app, the rotate button will always rotate the image by 90°, regardless of whether the user has previously adjusted the rotation via the slider.
However, the rotate left/right buttons in react-mobile-cropper
will only rotate by 90° if the rotation slider is set to exactly 0°.
Reproduction steps
- Set the rotation slider to -20°.
- Press the 'rotate left' button.
Current behaviour
The rotation slider is reset to 0° and the image rotation is 'snapped' to -90°.
Expected behaviour
The rotation slider should still be set to -20° and the image should be rotated to -110°.
Additional context
This appears to be intentional behaviour, based on the rotateLeft
and rotateRight
functions in Navigation.tsx.
Changing these functions to always rotate by 90° introduces a new issue where the useLayoutEffect
miscalculates the new adjustmentAngle
if the rotation slider is set to exactly -45° or 45°.