Fix rotation animation when rotating 360 deg

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-04-09 08:16:52 +02:00
parent 829bef45a2
commit 86dd81cda0
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -137,13 +137,13 @@ export default class ImageView extends React.Component<IProps, IState> {
private onRotateCounterClockwiseClick = () => {
const cur = this.state.rotation;
const rotationDegrees = (cur - 90) % 360;
const rotationDegrees = cur - 90;
this.setState({ rotation: rotationDegrees });
};
private onRotateClockwiseClick = () => {
const cur = this.state.rotation;
const rotationDegrees = (cur + 90) % 360;
const rotationDegrees = cur + 90;
this.setState({ rotation: rotationDegrees });
};