From 72d8e6ccca4a214231c1a6cbbba8aab7bbc62ed7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 15 Apr 2021 08:09:14 +0200 Subject: [PATCH 1/2] Decrease ZOOM_COEFFICIENT 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.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/elements/ImageView.tsx b/src/components/views/elements/ImageView.tsx index dad62521da..71e63d214d 100644 --- a/src/components/views/elements/ImageView.tsx +++ b/src/components/views/elements/ImageView.tsx @@ -38,7 +38,7 @@ const MAX_ZOOM = 300; // This is used for the buttons const ZOOM_STEP = 10; // This is used for mouse wheel events -const ZOOM_COEFFICIENT = 10; +const ZOOM_COEFFICIENT = 7.5; // If we have moved only this much we can zoom const ZOOM_DISTANCE = 10; From 2e31355741f7d7a837e5691cbee99db291e369b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Thu, 15 Apr 2021 08:10:03 +0200 Subject: [PATCH 2/2] Don't do anything if we didn't press the left button 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.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/views/elements/ImageView.tsx b/src/components/views/elements/ImageView.tsx index 71e63d214d..bb69e24855 100644 --- a/src/components/views/elements/ImageView.tsx +++ b/src/components/views/elements/ImageView.tsx @@ -209,6 +209,10 @@ export default class ImageView extends React.Component { ev.stopPropagation(); ev.preventDefault(); + // Don't do anything if we pressed any + // other button than the left one + if (ev.button !== 0) return; + // Zoom in if we are completely zoomed out if (this.state.zoom === MIN_ZOOM) { this.setState({zoom: MAX_ZOOM});