From 2ff34000fd0bc6fcd9aa460b729fb73f7fdd3091 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Fri, 2 Apr 2021 10:16:42 +0200 Subject: [PATCH] Reset translation with zoom out MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/elements/ImageView.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/ImageView.js b/src/components/views/elements/ImageView.js index 33a4b3a748..89f6780cf9 100644 --- a/src/components/views/elements/ImageView.js +++ b/src/components/views/elements/ImageView.js @@ -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});