Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Robustify checks for visibility
Conrad Irwinc2c7eead8a22
diff --git a/crates/gpui2/src/elements/div.rs b/crates/gpui2/src/elements/div.rsindex 6b1dd3e5458..bb8e76c627f 100644--- a/crates/gpui2/src/elements/div.rs+++ b/crates/gpui2/src/elements/div.rs@@ -642,10 +642,6 @@ impl Element for Div {&mut element_state.interactive_state,cx,|style, scroll_offset, cx| {- if style.visibility == Visibility::Hidden {- return;- }-let z_index = style.z_index.unwrap_or(0);cx.with_z_index(z_index, |cx| {@@ -779,6 +775,10 @@ impl Interactivity {) {let style = self.compute_style(Some(bounds), element_state, cx);+ if style.visibility == Visibility::Hidden {+ return;+ }+#[cfg(debug_assertions)]if self.element_id.is_some()&& (style.debug || style.debug_below || cx.has_global::<crate::DebugBelow>())@@ -890,11 +890,10 @@ impl Interactivity {});}- if style.visibility == Visibility::Visible- && style- .background- .as_ref()- .is_some_and(|fill| fill.color().is_some())+ if style+ .background+ .as_ref()+ .is_some_and(|fill| fill.color().is_some_and(|color| !color.is_transparent())){cx.with_z_index(style.z_index.unwrap_or(0), |cx| cx.add_opaque_layer(bounds))}