From 4d14f5568fcfda61c1c9aa01d4a305d0de89cfb8 Mon Sep 17 00:00:00 2001 From: Tom Grushka Date: Tue, 7 Jul 2026 20:03:28 -0600 Subject: [PATCH] improve comments --- src/shell/zoom.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shell/zoom.rs b/src/shell/zoom.rs index 1d5bbf1e..a8da3561 100644 --- a/src/shell/zoom.rs +++ b/src/shell/zoom.rs @@ -270,11 +270,13 @@ impl ZoomState { } ZoomMovement::OnEdge => { if is_level_change { + // Ensure the cursor doesn't disappear off screen output_state_ref.focal_point = cursor_position; return; } // Compute small margin relative to zoomed output to keep cursor within + // (can be user-configurable in the future) let margin_size = zoomed_output_geometry.size.h * 0.02; let margins = FrameExtents::new(margin_size, margin_size, margin_size, margin_size); let inner_rect = zoomed_output_geometry - margins; @@ -318,7 +320,7 @@ impl ZoomState { let center = (output_geometry.size / 2.).to_point(); if level <= 1.0 + f64::EPSILON { - // Without this break, focal point will jump to (0, 0) on zoom out + // Prevent focal point jumping to top-left corner (0, 0) on zoom out output_state_ref.focal_point = center; return; }