summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-10-08 17:05:32 +0200
committerGitHub <noreply@github.com>2019-10-08 17:05:32 +0200
commitf46bf8e721d17f263437f4786454401b52721bc6 (patch)
tree841b7afde10afdd7e867424896949b353efdc926
parente1243f75b2c286e278fb73540bab47651684a8a6 (diff)
parent07f3a129c66d2139655cf7a741a4e37db415b088 (diff)
Merge pull request #32411 from YeldhamDev/fix_grid_overflow
Fix GridContainer's children overflowing it when not all slots of a row are occupied
-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 d304a37f82..154e67b6f3 100644
--- a/scene/gui/grid_container.cpp
+++ b/scene/gui/grid_container.cpp
@@ -44,7 +44,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.
int valid_controls_index = 0;