There was an error while loading. Please reload this page.
1 parent 6239fdb commit 4e91891Copy full SHA for 4e91891
1 file changed
crates/rnote-ui/src/canvaswrapper.rs
@@ -580,11 +580,8 @@ mod imp {
580
move |gesture, scale| {
581
let canvas = canvaswrapper.canvas();
582
let old_zoom = canvas.engine_ref().camera.total_zoom();
583
- let new_zoom = zoom_begin.get() * scale;
584
-
585
- if !(Camera::ZOOM_MIN..=Camera::ZOOM_MAX).contains(&new_zoom) {
586
- return;
587
- }
+ let new_zoom =
+ (zoom_begin.get() * scale).clamp(Camera::ZOOM_MIN, Camera::ZOOM_MAX);
588
589
let mut widget_flags = canvas.engine_mut().zoom_w_timeout(new_zoom);
590
0 commit comments