diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-10-30 12:06:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-30 12:06:30 +0100 |
commit | a23d8eafa32153a58e921194c03143d4b8dd037d (patch) | |
tree | 34af336362d10c41829b550d38cfb703a4aee47c | |
parent | 644e810cef4b004cf1340d3c5fb96b87879f84ab (diff) | |
parent | 6ed15e995dd83c1cf6808f261066580a1f8bc297 (diff) | |
download | redot-engine-a23d8eafa32153a58e921194c03143d4b8dd037d.tar.gz |
Merge pull request #6928 from razvanc-r/fix-container
make Container node aware of Size Flags
-rw-r--r-- | scene/gui/container.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/scene/gui/container.cpp b/scene/gui/container.cpp index feaf516f42..83a4f34282 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; i<get_child_count();i++) { + Control *c = get_child(i)->cast_to<Control>(); + if (!c || !c->is_visible() || c->is_set_as_toplevel()) + continue; + + fit_child_in_rect(c,Rect2(0, 0, s.width, s.height)); + } + } } } |