Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Fix flickering cursor style when a pane was zoomed (#8546)
Antonio Scandurra57f5f128f3f5
diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rsindex 4922296dd00..d5dac7d6602 100644--- a/crates/editor/src/element.rs+++ b/crates/editor/src/element.rs@@ -716,6 +716,11 @@ impl EditorElement {let scroll_position = layout.position_map.snapshot.scroll_position();let scroll_top = scroll_position.y * line_height;+ if bounds.contains(&cx.mouse_position()) {+ let stacking_order = cx.stacking_order().clone();+ cx.set_cursor_style(CursorStyle::Arrow, stacking_order);+ }+let show_git_gutter = matches!(ProjectSettings::get_global(cx).git.git_gutter,Some(GitGutterSetting::TrackedFiles)@@ -915,7 +920,7 @@ impl EditorElement {bounds: text_bounds,stacking_order: cx.stacking_order().clone(),};- if interactive_text_bounds.visibly_contains(&cx.mouse_position(), cx) {+ if text_bounds.contains(&cx.mouse_position()) {if self.editor.read(cx)@@ -1557,7 +1562,7 @@ impl EditorElement {stacking_order: cx.stacking_order().clone(),};let mut mouse_position = cx.mouse_position();- if interactive_track_bounds.visibly_contains(&mouse_position, cx) {+ if track_bounds.contains(&mouse_position) {cx.set_cursor_style(CursorStyle::Arrow,interactive_track_bounds.stacking_order.clone(),diff --git a/crates/gpui/src/window/element_cx.rs b/crates/gpui/src/window/element_cx.rsindex 83e2ec18eff..46b5a21cf37 100644--- a/crates/gpui/src/window/element_cx.rs+++ b/crates/gpui/src/window/element_cx.rs@@ -409,7 +409,7 @@ impl<'a> ElementContext<'a> {.requested_cursor_style.as_ref().map_or(true, |prev_style_request| {- style_request.stacking_order > prev_style_request.stacking_order+ style_request.stacking_order >= prev_style_request.stacking_order}){self.window.next_frame.requested_cursor_style = Some(style_request.clone());