Prevent division by zero in GridContainer

(cherry picked from commit 38623e07ac)
This commit is contained in:
Leon Krause 2018-03-07 17:31:30 +01:00 committed by Hein-Pieter van Braam
parent 5042d0c30a
commit a5ccaa919e
1 changed files with 2 additions and 2 deletions

View File

@ -130,8 +130,8 @@ void GridContainer::_notification(int p_what) {
}
// Finally, fit the nodes
int col_expand = remaining_space.width / col_expanded.size();
int row_expand = remaining_space.height / row_expanded.size();
int col_expand = col_expanded.size() > 0 ? remaining_space.width / col_expanded.size() : 0;
int row_expand = row_expanded.size() > 0 ? remaining_space.height / row_expanded.size() : 0;
int col_ofs = 0;
int row_ofs = 0;