Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Checkpoint

Antonio Scandurrac126ff10a764
diff --git a/crates/gpui3/src/elements/div.rs b/crates/gpui3/src/elements/div.rs
index 41874d9e89f..03229dc1da5 100644
--- a/crates/gpui3/src/elements/div.rs
+++ b/crates/gpui3/src/elements/div.rs
@@ -61,7 +61,7 @@ where
let child_layout_ids = style.apply_text_style(cx, |cx| {
self.with_element_id(cx, |this, cx| this.layout_children(view, cx))
});
- let layout_id = cx.request_layout(style.into(), child_layout_ids.clone());
+ let layout_id = cx.request_layout(&style, child_layout_ids.clone());
(layout_id, ())
}
diff --git a/crates/gpui3/src/elements/img.rs b/crates/gpui3/src/elements/img.rs
index 8709707f319..a8e65fa0ff6 100644
--- a/crates/gpui3/src/elements/img.rs
+++ b/crates/gpui3/src/elements/img.rs
@@ -62,7 +62,7 @@ impl<S: Send + Sync + 'static> Element for Img<S> {
Self: Sized,
{
let style = self.computed_style();
- let layout_id = cx.request_layout(style, []);
+ let layout_id = cx.request_layout(&style, []);
(layout_id, ())
}
diff --git a/crates/gpui3/src/elements/nested.rs b/crates/gpui3/src/elements/nested.rs
index 532654958a9..297460f320f 100644
--- a/crates/gpui3/src/elements/nested.rs
+++ b/crates/gpui3/src/elements/nested.rs
@@ -134,7 +134,7 @@ impl<V: 'static + Send + Sync, K: ElementKind> Element for LayoutNodeElement<V,
.map(|child| child.layout(state, cx))
.collect::<Vec<_>>();
- let style = this.computed_style().clone();
+ let style = this.computed_style();
let layout_id = cx.request_layout(style, layout_ids);
(layout_id, ())
})
diff --git a/crates/gpui3/src/elements/svg.rs b/crates/gpui3/src/elements/svg.rs
index cd11c927514..c81eff7aa9a 100644
--- a/crates/gpui3/src/elements/svg.rs
+++ b/crates/gpui3/src/elements/svg.rs
@@ -53,7 +53,7 @@ impl<S: 'static + Send + Sync> Element for Svg<S> {
Self: Sized,
{
let style = self.computed_style();
- (cx.request_layout(style, []), ())
+ (cx.request_layout(&style, []), ())
}
fn paint(
diff --git a/crates/gpui3/src/taffy.rs b/crates/gpui3/src/taffy.rs
index cadb7e1b57b..71844bb8a63 100644
--- a/crates/gpui3/src/taffy.rs
+++ b/crates/gpui3/src/taffy.rs
@@ -28,7 +28,7 @@ impl TaffyLayoutEngine {
pub fn request_layout(
&mut self,
- style: Style,
+ style: &Style,
rem_size: Pixels,
children: &[LayoutId],
) -> LayoutId {
diff --git a/crates/gpui3/src/window.rs b/crates/gpui3/src/window.rs
index b57f152f210..fa52941ead8 100644
--- a/crates/gpui3/src/window.rs
+++ b/crates/gpui3/src/window.rs
@@ -248,7 +248,7 @@ impl<'a, 'w> WindowContext<'a, 'w> {
pub fn request_layout(
&mut self,
- style: Style,
+ style: &Style,
children: impl IntoIterator<Item = LayoutId>,
) -> LayoutId {
self.app.layout_id_buffer.clear();