mirror of
https://github.com/penpot/penpot.git
synced 2025-12-11 22:14:05 +01:00
✨ Improvements on flex layout positioning
This commit is contained in:
@@ -690,7 +690,19 @@ impl RenderState {
|
||||
if element.is_recursive() {
|
||||
let children_clip_bounds = node_render_state
|
||||
.get_children_clip_bounds(element, modifiers.get(&element.id));
|
||||
for child_id in element.children_ids().iter().rev() {
|
||||
|
||||
let mut children_ids = element.children_ids();
|
||||
|
||||
// Z-index ordering on Layouts
|
||||
if element.has_layout() {
|
||||
children_ids.sort_by(|id1, id2| {
|
||||
let z1 = tree.get(id1).map_or_else(|| 0, |s| s.z_index());
|
||||
let z2 = tree.get(id2).map_or_else(|| 0, |s| s.z_index());
|
||||
z1.cmp(&z2)
|
||||
});
|
||||
}
|
||||
|
||||
for child_id in children_ids.iter().rev() {
|
||||
self.pending_nodes.push(NodeRenderState {
|
||||
id: *child_id,
|
||||
visited_children: false,
|
||||
|
||||
Reference in New Issue
Block a user