Browse Source

Merge pull request #32411 from YeldhamDev/fix_grid_overflow

Fix GridContainer's children overflowing it when not all slots of a row are occupied
Rémi Verschelde 6 years ago
parent
commit
f46bf8e721
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scene/gui/grid_container.cpp

+ 1 - 1
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;