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.

Remove `Flex::with_reversed_pain_order`

Julia6a731233c5c9
diff --git a/crates/collab_ui/src/collab_titlebar_item.rs b/crates/collab_ui/src/collab_titlebar_item.rs
index 72e885b84e6..48a1a0f2633 100644
--- a/crates/collab_ui/src/collab_titlebar_item.rs
+++ b/crates/collab_ui/src/collab_titlebar_item.rs
@@ -628,7 +628,6 @@ impl CollabTitlebarItem {
let content = Stack::new()
.with_children(user.avatar.as_ref().map(|avatar| {
let flex = Flex::row()
- // .with_reversed_paint_order()
.with_child(Self::render_face(avatar.clone(), avatar_style.clone()))
.with_children(
(|| {
diff --git a/crates/gpui/src/elements/flex.rs b/crates/gpui/src/elements/flex.rs
index 4e52032f67a..ce595222f3f 100644
--- a/crates/gpui/src/elements/flex.rs
+++ b/crates/gpui/src/elements/flex.rs
@@ -20,7 +20,6 @@ struct ScrollState {
pub struct Flex {
axis: Axis,
- paint_reversed: bool,
children: Vec<ElementBox>,
scroll_state: Option<(ElementStateHandle<Rc<ScrollState>>, usize)>,
}
@@ -29,7 +28,6 @@ impl Flex {
pub fn new(axis: Axis) -> Self {
Self {
axis,
- paint_reversed: false,
children: Default::default(),
scroll_state: None,
}
@@ -43,11 +41,6 @@ impl Flex {
Self::new(Axis::Vertical)
}
- pub fn with_reversed_paint_order(mut self) -> Self {
- self.paint_reversed = true;
- self
- }
-
pub fn scrollable<Tag, V>(
mut self,
element_id: usize,
@@ -303,7 +296,7 @@ impl Element for Flex {
}
}
- let mut child_action = |child: &mut ElementBox| {
+ for child in &mut self.children {
if remaining_space > 0. {
if let Some(metadata) = child.metadata::<FlexParentData>() {
if metadata.float {
@@ -322,16 +315,6 @@ impl Element for Flex {
Axis::Horizontal => child_origin += vec2f(child.size().x(), 0.0),
Axis::Vertical => child_origin += vec2f(0.0, child.size().y()),
}
- };
-
- if self.paint_reversed {
- for child in self.children.iter_mut().rev() {
- child_action(child);
- }
- } else {
- for child in &mut self.children {
- child_action(child);
- }
}
if overflowing {