diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index 6c74bc39777..8cdf4dd0393 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -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()) + return; + + queue_sort(); +} + void Container::remove_child_notify(Node *p_child) { diff --git a/scene/gui/container.h b/scene/gui/container.h index ba9bf2d60fc..04d5d6ab365 100644 --- a/scene/gui/container.h +++ b/scene/gui/container.h @@ -42,6 +42,7 @@ protected: void queue_sort(); virtual void add_child_notify(Node *p_child); + virtual void move_child_notify(Node *p_child); virtual void remove_child_notify(Node *p_child); void _notification(int p_what);