1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add container automatic update when moving a child node

This commit is contained in:
Franklin Sobrinho
2015-11-28 13:05:39 -03:00
parent 274b17b636
commit 43e1b879d0
2 changed files with 9 additions and 0 deletions

View File

@@ -52,6 +52,14 @@ void Container::add_child_notify(Node *p_child) {
} }
void Container::move_child_notify(Node *p_child) {
if (!p_child->cast_to<Control>())
return;
queue_sort();
}
void Container::remove_child_notify(Node *p_child) { void Container::remove_child_notify(Node *p_child) {

View File

@@ -42,6 +42,7 @@ protected:
void queue_sort(); void queue_sort();
virtual void add_child_notify(Node *p_child); virtual void add_child_notify(Node *p_child);
virtual void move_child_notify(Node *p_child);
virtual void remove_child_notify(Node *p_child); virtual void remove_child_notify(Node *p_child);
void _notification(int p_what); void _notification(int p_what);