Fix GridContainer's children overflowing it when not all slots of a row are occupied

This commit is contained in:
Michael Alexsander Silva Dias 2019-09-28 02:57:11 -03:00
parent 7a67ae01a4
commit 07f3a129c6

View File

@ -46,7 +46,7 @@ void GridContainer::_notification(int p_what) {
int hsep = get_constant("hseparation");
int vsep = get_constant("vseparation");
int max_col = MIN(get_child_count(), columns);
int max_row = get_child_count() / columns;
int max_row = ceil((float)get_child_count() / (float)columns);
// Compute the per-column/per-row data
valid_controls_index = 0;