mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 15:44:31 +03:00
Remove Flex::with_reversed_pain_order
This commit is contained in:
parent
b7cf426908
commit
6a731233c5
@ -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(
|
||||
(|| {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user