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
This commit is contained in:
parent
73c921b042
commit
a761eb5b2d
2 changed files with 3 additions and 2 deletions
1
news.d/49.2/fixed-no-zoom-when-window-too-large
Normal file
1
news.d/49.2/fixed-no-zoom-when-window-too-large
Normal file
|
|
@ -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.
|
||||||
|
|
@ -48,9 +48,9 @@ impl imp::LpImage {
|
||||||
|
|
||||||
let max_zoom_factor = match self.fit_mode.get() {
|
let max_zoom_factor = match self.fit_mode.get() {
|
||||||
// Do not allow to zoom larger than original size
|
// Do not allow to zoom larger than original size
|
||||||
FitMode::BestFit => 1.,
|
FitMode::BestFit | FitMode::ExactVolatile => 1.,
|
||||||
// Allow arbitrary zoom
|
// Allow arbitrary zoom
|
||||||
FitMode::LargeFit | FitMode::ExactVolatile => f64::MAX,
|
FitMode::LargeFit => f64::MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
let default_zoom = if texture_aspect_ratio > widget_aspect_ratio {
|
let default_zoom = if texture_aspect_ratio > widget_aspect_ratio {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue