From 0e984e1e69e7125ed38397556f67fcde1e80a415 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 20 Jul 2023 11:11:47 -0600 Subject: [PATCH] Ignore off-screen cursors --- crates/workspace/src/workspace.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/workspace/src/workspace.rs b/crates/workspace/src/workspace.rs index 2f3f2f9010a827d1d0323a3705bab4410c621d47..0ebd01e1f7a706e1e2baf3b15ff1f35a51a3fb7f 100644 --- a/crates/workspace/src/workspace.rs +++ b/crates/workspace/src/workspace.rs @@ -2077,8 +2077,8 @@ impl Workspace { }; let cursor = self.active_pane.read(cx).pixel_position_of_cursor(cx); let center = match cursor { - Some(cursor) => cursor, - None => bounding_box.center(), + Some(cursor) if bounding_box.contains_point(cursor) => cursor, + _ => bounding_box.center(), }; let distance_to_next = theme::current(cx).workspace.pane_divider.width + 1.;