From ccfbcf60a8f5f2c20bf48b5efd2efc3f01315d32 Mon Sep 17 00:00:00 2001 From: Sophie Herold Date: Tue, 29 Nov 2022 00:04:13 +0100 Subject: [PATCH] image: Calculate next zoom step from target This fixes that clicking a button/key during an animation does not give you the expected zoom speedup. --- src/widgets/image.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/image.rs b/src/widgets/image.rs index 6bbf042..ca5f5b4 100644 --- a/src/widgets/image.rs +++ b/src/widgets/image.rs @@ -729,7 +729,7 @@ impl LpImage { /// /// Used by buttons pub fn zoom_in(&self) { - let zoom = self.zoom() * ZOOM_FACTOR_BUTTON; + let zoom = self.imp().zoom_target.get() * ZOOM_FACTOR_BUTTON; self.zoom_to(zoom); } @@ -738,7 +738,7 @@ impl LpImage { /// /// Used by buttons pub fn zoom_out(&self) { - let zoom = self.zoom() / ZOOM_FACTOR_BUTTON; + let zoom = self.imp().zoom_target.get() / ZOOM_FACTOR_BUTTON; self.zoom_to(zoom); }