From 0596cce40d93df7518738ae9f8c631fa413ac4a9 Mon Sep 17 00:00:00 2001 From: Tom Grushka Date: Wed, 8 Jul 2026 14:43:32 -0600 Subject: [PATCH] remove redundant level condition; simplify level early return on ZoomMovement::Centered --- src/shell/mod.rs | 12 +++++------- src/shell/zoom.rs | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/shell/mod.rs b/src/shell/mod.rs index 83845598..326b064b 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -2491,13 +2491,11 @@ impl Shell { movement: zoom_config.view_moves, }); - if level > 1.0 { - self.update_focal_point( - seat, - seat.get_pointer().unwrap().current_location().as_global(), - zoom_config.view_moves, - ); - } + self.update_focal_point( + seat, + seat.get_pointer().unwrap().current_location().as_global(), + zoom_config.view_moves, + ); } pub fn update_focal_point( diff --git a/src/shell/zoom.rs b/src/shell/zoom.rs index a8da3561..ef81053f 100644 --- a/src/shell/zoom.rs +++ b/src/shell/zoom.rs @@ -319,7 +319,7 @@ impl ZoomState { ZoomMovement::Centered => { let center = (output_geometry.size / 2.).to_point(); - if level <= 1.0 + f64::EPSILON { + if level == 1.0 { // Prevent focal point jumping to top-left corner (0, 0) on zoom out output_state_ref.focal_point = center; return;