Remove Flex::with_reversed_pain_order

This commit is contained in:
Julia 2023-02-21 11:40:48 -05:00
parent b7cf426908
commit 6a731233c5
2 changed files with 1 additions and 19 deletions

View File

@ -628,7 +628,6 @@ impl CollabTitlebarItem {
let content = Stack::new() let content = Stack::new()
.with_children(user.avatar.as_ref().map(|avatar| { .with_children(user.avatar.as_ref().map(|avatar| {
let flex = Flex::row() let flex = Flex::row()
// .with_reversed_paint_order()
.with_child(Self::render_face(avatar.clone(), avatar_style.clone())) .with_child(Self::render_face(avatar.clone(), avatar_style.clone()))
.with_children( .with_children(
(|| { (|| {

View File

@ -20,7 +20,6 @@ struct ScrollState {
pub struct Flex { pub struct Flex {
axis: Axis, axis: Axis,
paint_reversed: bool,
children: Vec<ElementBox>, children: Vec<ElementBox>,
scroll_state: Option<(ElementStateHandle<Rc<ScrollState>>, usize)>, scroll_state: Option<(ElementStateHandle<Rc<ScrollState>>, usize)>,
} }
@ -29,7 +28,6 @@ impl Flex {
pub fn new(axis: Axis) -> Self { pub fn new(axis: Axis) -> Self {
Self { Self {
axis, axis,
paint_reversed: false,
children: Default::default(), children: Default::default(),
scroll_state: None, scroll_state: None,
} }
@ -43,11 +41,6 @@ impl Flex {
Self::new(Axis::Vertical) Self::new(Axis::Vertical)
} }
pub fn with_reversed_paint_order(mut self) -> Self {
self.paint_reversed = true;
self
}
pub fn scrollable<Tag, V>( pub fn scrollable<Tag, V>(
mut self, mut self,
element_id: usize, 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 remaining_space > 0. {
if let Some(metadata) = child.metadata::<FlexParentData>() { if let Some(metadata) = child.metadata::<FlexParentData>() {
if metadata.float { if metadata.float {
@ -322,16 +315,6 @@ impl Element for Flex {
Axis::Horizontal => child_origin += vec2f(child.size().x(), 0.0), Axis::Horizontal => child_origin += vec2f(child.size().x(), 0.0),
Axis::Vertical => child_origin += vec2f(0.0, child.size().y()), 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 { if overflowing {