image/zoom: Keep best-fit zoom in gesture
Don't change the zoom in configure best fit if currently in gesture.
This commit is contained in:
parent
83b2c7cae1
commit
f255af9f6a
2 changed files with 12 additions and 4 deletions
1
news.d/49.2/fixed-zoom-gesture-jump
Normal file
1
news.d/49.2/fixed-zoom-gesture-jump
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Don't jump to best-fit zoom level during pinch zoom gesture when scroolbars get displayed. This has only been an issue with the disability option "always show scrollbars."
|
||||||
|
|
@ -70,12 +70,19 @@ impl imp::LpImage {
|
||||||
|
|
||||||
/// Sets respective output values if best-fit is active
|
/// Sets respective output values if best-fit is active
|
||||||
pub(super) fn configure_best_fit(&self) {
|
pub(super) fn configure_best_fit(&self) {
|
||||||
|
log::trace!("Configure best fit");
|
||||||
// calculate new zoom value for best fit
|
// calculate new zoom value for best fit
|
||||||
if self.obj().is_best_fit() {
|
if self.obj().is_best_fit() {
|
||||||
let best_fit_level = self.zoom_level_best_fit();
|
// LpImage can get measured during pinch zoom gesture, when scrollbars appear
|
||||||
self.zoom.set(best_fit_level);
|
// that are not overlayed (accessibility option.) This causes the best-fit to
|
||||||
self.set_zoom_target(best_fit_level);
|
// change. Don't change the zoom level in this case since we are in the gesture
|
||||||
self.zoom_animation().pause();
|
// that will change the zoom level anyway.
|
||||||
|
if self.locked_gestured.get().is_none() {
|
||||||
|
let best_fit_level = self.zoom_level_best_fit();
|
||||||
|
self.zoom.set(best_fit_level);
|
||||||
|
self.set_zoom_target(best_fit_level);
|
||||||
|
self.zoom_animation().pause();
|
||||||
|
}
|
||||||
self.configure_adjustments();
|
self.configure_adjustments();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue