From 7e2ff63270e6779350fdbf7b0f6d49a3e7668612 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 6 Dec 2023 19:15:09 +0100 Subject: [PATCH] Paint blocks on top of the editor This ensures blocks get mouse events before the editor beneath them. Co-Authored-By: Marshall --- crates/editor2/src/element.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/editor2/src/element.rs b/crates/editor2/src/element.rs index ab11f5ffb5..d7badd4ab5 100644 --- a/crates/editor2/src/element.rs +++ b/crates/editor2/src/element.rs @@ -2835,8 +2835,10 @@ impl Element for EditorElement { self.paint_text(text_bounds, &mut layout, cx); if !layout.blocks.is_empty() { - cx.with_element_id(Some("editor_blocks"), |cx| { - self.paint_blocks(bounds, &mut layout, cx); + cx.with_z_index(1, |cx| { + cx.with_element_id(Some("editor_blocks"), |cx| { + self.paint_blocks(bounds, &mut layout, cx); + }) }) } });