From 6ed15e995dd83c1cf6808f261066580a1f8bc297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C4=83zvan=20Cosmin=20R=C4=83dulescu?= Date: Wed, 26 Oct 2016 11:45:16 +0200 Subject: [PATCH] make `Container` node aware of `Size Flags` --- scene/gui/container.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index feaf516f42d..83a4f342827 100644 --- a/scene/gui/container.cpp +++ b/scene/gui/container.cpp @@ -151,6 +151,18 @@ void Container::_notification(int p_what) { queue_sort(); } } break; + case NOTIFICATION_SORT_CHILDREN: { + + Size2 s = get_size(); + + for (int i=0; icast_to(); + if (!c || !c->is_visible() || c->is_set_as_toplevel()) + continue; + + fit_child_in_rect(c,Rect2(0, 0, s.width, s.height)); + } + } } }