Reset translation with zoom out

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-04-02 10:16:42 +02:00
parent 7068996b60
commit 2ff34000fd
No known key found for this signature in database
GPG Key ID: 9760693FDD98A790
1 changed files with 5 additions and 1 deletions

View File

@ -222,7 +222,11 @@ export default class ImageView extends React.Component {
if (this.state.zoom === MIN_ZOOM) {
this.setState({zoom: MAX_ZOOM});
} else {
this.setState({zoom: MIN_ZOOM});
this.setState({
zoom: MIN_ZOOM,
translationX: 0,
translationY: 0,
});
}
}
this.setState({moving: false});