Fix rotation animation when rotating 360 deg
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
829bef45a2
commit
86dd81cda0
1 changed files with 2 additions and 2 deletions
|
@ -137,13 +137,13 @@ export default class ImageView extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
private onRotateCounterClockwiseClick = () => {
|
private onRotateCounterClockwiseClick = () => {
|
||||||
const cur = this.state.rotation;
|
const cur = this.state.rotation;
|
||||||
const rotationDegrees = (cur - 90) % 360;
|
const rotationDegrees = cur - 90;
|
||||||
this.setState({ rotation: rotationDegrees });
|
this.setState({ rotation: rotationDegrees });
|
||||||
};
|
};
|
||||||
|
|
||||||
private onRotateClockwiseClick = () => {
|
private onRotateClockwiseClick = () => {
|
||||||
const cur = this.state.rotation;
|
const cur = this.state.rotation;
|
||||||
const rotationDegrees = (cur + 90) % 360;
|
const rotationDegrees = cur + 90;
|
||||||
this.setState({ rotation: rotationDegrees });
|
this.setState({ rotation: rotationDegrees });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue