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.
This commit is contained in:
Sophie Herold 2022-11-29 00:04:13 +01:00
parent 78e528d299
commit ccfbcf60a8

View file

@ -729,7 +729,7 @@ impl LpImage {
/// ///
/// Used by buttons /// Used by buttons
pub fn zoom_in(&self) { 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); self.zoom_to(zoom);
} }
@ -738,7 +738,7 @@ impl LpImage {
/// ///
/// Used by buttons /// Used by buttons
pub fn zoom_out(&self) { 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); self.zoom_to(zoom);
} }