1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Merge pull request #32411 from YeldhamDev/fix_grid_overflow

Fix GridContainer's children overflowing it when not all slots of a row are occupied
This commit is contained in:
Rémi Verschelde
2019-10-08 17:05:32 +02:00
committed by GitHub

View File

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