mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Make YSort stable
Keeps track of the order in which items are collected by
_collect_ysort_children, and uses that order to break
ties between items with similar Y positions.
(cherry picked from commit 8d3afa985b
)
This commit is contained in:
parent
fbafd5c9e2
commit
f8cc7893d0
2 changed files with 6 additions and 2 deletions
|
@ -62,6 +62,7 @@ void _collect_ysort_children(VisualServerCanvas::Item *p_canvas_item, Transform2
|
|||
child_items[i]->ysort_xform = p_transform;
|
||||
child_items[i]->ysort_pos = p_transform.xform(child_items[i]->xform.elements[2]);
|
||||
child_items[i]->material_owner = child_items[i]->use_parent_material ? p_material_owner : NULL;
|
||||
child_items[i]->ysort_index = r_index;
|
||||
}
|
||||
|
||||
r_index++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue