summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2019-09-28 02:57:11 -0300
committerMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2019-09-28 02:57:11 -0300
commit07f3a129c66d2139655cf7a741a4e37db415b088 (patch)
tree34a2c30a276901baa40a5619aff93baf15f65653 /scene
parent7a67ae01a47cc08fbd66f3c4e780118fbc07ef91 (diff)
Fix GridContainer's children overflowing it when not all slots of a row are occupied
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/grid_container.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp
index d0e2edc7b5..50217682ce 100644
--- a/scene/gui/grid_container.cpp
+++ b/scene/gui/grid_container.cpp
@@ -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;