From c6f3f439c4128b3fff1569e27cb7bb6327aa5bf8 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 23 Dec 2023 01:55:40 +0200 Subject: [PATCH] Fix mouse listeners' z-index for editor --- crates/editor2/src/element.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs index 9e1d8e641f..f7feba9292 100644 --- a/crates/editor2/src/element.rs +++ b/crates/editor2/src/element.rs @@ -2840,17 +2840,13 @@ impl Element for EditorElement { } self.paint_text(text_bounds, &mut layout, cx); + cx.with_z_index(0, |cx| { + self.paint_mouse_listeners(bounds, gutter_bounds, text_bounds, &layout, cx); + }); if !layout.blocks.is_empty() { cx.with_z_index(0, |cx| { cx.with_element_id(Some("editor_blocks"), |cx| { self.paint_blocks(bounds, &mut layout, cx); - self.paint_mouse_listeners( - bounds, - gutter_bounds, - text_bounds, - &layout, - cx, - ); }); }) }