From a761eb5b2d161210b9f08d235b48d5000c72ab3a Mon Sep 17 00:00:00 2001 From: Sophie Herold Date: Mon, 22 Dec 2025 14:14:38 +0100 Subject: [PATCH] image/zoom: Zoom >=1 no best fit for ExactVolatile The best-fit calculation would consider levels >=1 for best-fit. This seems fundamentally wrong since that should be reserved for LargeFit. This caused zoom-in to fail since best-fit was considered instead. But that best-fit was computed with BestFit mode since the mode changed in between in zoom_to_full. Fixes #556 --- news.d/49.2/fixed-no-zoom-when-window-too-large | 1 + src/widgets/image/zoom.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 news.d/49.2/fixed-no-zoom-when-window-too-large diff --git a/news.d/49.2/fixed-no-zoom-when-window-too-large b/news.d/49.2/fixed-no-zoom-when-window-too-large new file mode 100644 index 0000000..2cf32ce --- /dev/null +++ b/news.d/49.2/fixed-no-zoom-when-window-too-large @@ -0,0 +1 @@ +Zooming in would not work via the zoom menu, if the resulting zoom state would still fit the image inside the window. diff --git a/src/widgets/image/zoom.rs b/src/widgets/image/zoom.rs index 13017e1..9ddf095 100644 --- a/src/widgets/image/zoom.rs +++ b/src/widgets/image/zoom.rs @@ -48,9 +48,9 @@ impl imp::LpImage { let max_zoom_factor = match self.fit_mode.get() { // Do not allow to zoom larger than original size - FitMode::BestFit => 1., + FitMode::BestFit | FitMode::ExactVolatile => 1., // Allow arbitrary zoom - FitMode::LargeFit | FitMode::ExactVolatile => f64::MAX, + FitMode::LargeFit => f64::MAX, }; let default_zoom = if texture_aspect_ratio > widget_aspect_ratio {