mirror of
https://github.com/godotengine/godot.git
synced 2024-11-24 13:12:42 +00:00
Merge pull request #75767 from spanzeri/missing-node-index-update-on-deletion
Update sibling indices after a node is removed.
This commit is contained in:
commit
132000f58d
@ -1215,6 +1215,10 @@ void Node::remove_child(Node *p_child) {
|
||||
child_count = data.children.size();
|
||||
children = data.children.ptrw();
|
||||
|
||||
for (int i = idx; i < child_count; i++) {
|
||||
children[i]->data.index = i;
|
||||
}
|
||||
|
||||
notification(NOTIFICATION_CHILD_ORDER_CHANGED);
|
||||
emit_signal(SNAME("child_order_changed"));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user