Merge pull request #6928 from razvanc-r/fix-container

make Container node aware of Size Flags
This commit is contained in:
Rémi Verschelde 2016-10-30 12:06:30 +01:00 committed by GitHub
commit a23d8eafa3

View File

@ -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));
}
}
}
}