mirror of https://github.com/vector-im/riot-web
Fix rotation animation when rotating 360 deg
Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>pull/21833/head
parent
829bef45a2
commit
86dd81cda0
|
@ -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 New Issue