You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Mark node groups as dirty for every children if parent is moved
This commit is contained in:
@@ -417,11 +417,7 @@ void Node::move_child(Node *p_child, int p_pos) {
|
||||
for (int i = motion_from; i <= motion_to; i++) {
|
||||
data.children[i]->notification(NOTIFICATION_MOVED_IN_PARENT);
|
||||
}
|
||||
for (const Map<StringName, GroupData>::Element *E = p_child->data.grouped.front(); E; E = E->next()) {
|
||||
if (E->get().group) {
|
||||
E->get().group->changed = true;
|
||||
}
|
||||
}
|
||||
p_child->_propagate_groups_dirty();
|
||||
|
||||
data.blocked--;
|
||||
}
|
||||
@@ -434,6 +430,18 @@ void Node::raise() {
|
||||
data.parent->move_child(this, data.parent->data.children.size() - 1);
|
||||
}
|
||||
|
||||
void Node::_propagate_groups_dirty() {
|
||||
for (const Map<StringName, GroupData>::Element *E = data.grouped.front(); E; E = E->next()) {
|
||||
if (E->get().group) {
|
||||
E->get().group->changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < data.children.size(); i++) {
|
||||
data.children[i]->_propagate_groups_dirty();
|
||||
}
|
||||
}
|
||||
|
||||
void Node::add_child_notify(Node *p_child) {
|
||||
// to be used when not wanted
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user