summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRăzvan Cosmin Rădulescu <razvancosmin.radulescu@gmail.com>2016-10-26 11:45:16 +0200
committerRăzvan Cosmin Rădulescu <razvancosmin.radulescu@gmail.com>2016-10-26 11:45:16 +0200
commit6ed15e995dd83c1cf6808f261066580a1f8bc297 (patch)
tree102373a3caa8e68152bfb493fd046d8435ff8900 /scene
parentc7f9d853e206c15981330af46cfd0a0fc43fc5ef (diff)
make `Container` node aware of `Size Flags`
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/container.cpp12
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));
+ }
+ }
}
}