Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Don't move `interactivity` unnecessarily during `layout`
Antonio Scandurrae7094cc98d3e
diff --git a/crates/gpui2/src/elements/div.rs b/crates/gpui2/src/elements/div.rsindex 7c365d8734f..73fcb73c98a 100644--- a/crates/gpui2/src/elements/div.rs+++ b/crates/gpui2/src/elements/div.rs@@ -602,8 +602,7 @@ impl Element for Div {cx: &mut WindowContext,) -> (LayoutId, Self::State) {let mut child_layout_ids = SmallVec::new();- let mut interactivity = mem::take(&mut self.interactivity);- let (layout_id, interactive_state) = interactivity.layout(+ let (layout_id, interactive_state) = self.interactivity.layout(element_state.map(|s| s.interactive_state),cx,|style, cx| {@@ -617,7 +616,6 @@ impl Element for Div {})},);- self.interactivity = interactivity;(layout_id,DivState {