diff options
| author | Leon Krause | 2018-03-07 17:31:30 +0100 |
|---|---|---|
| committer | Hein-Pieter van Braam | 2018-03-29 00:12:35 +0200 |
| commit | a5ccaa919e897a4da8bc9e75ff82ad7676d0c605 (patch) | |
| tree | 70eadeed7f9480d198b826b567a9cd61caf513e1 /scene/gui/grid_container.cpp | |
| parent | 5042d0c30a6c496b1399bad388ca62bc4fb93b4b (diff) | |
| download | godot-a5ccaa919e897a4da8bc9e75ff82ad7676d0c605.tar.gz godot-a5ccaa919e897a4da8bc9e75ff82ad7676d0c605.tar.zst godot-a5ccaa919e897a4da8bc9e75ff82ad7676d0c605.zip | |
Prevent division by zero in GridContainer
(cherry picked from commit 38623e07acb5addbd47b046d7734510d4e074156)
Diffstat (limited to '')
| -rw-r--r-- | scene/gui/grid_container.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/grid_container.cpp b/scene/gui/grid_container.cpp index b7c7c533d..2799131f7 100644 --- a/scene/gui/grid_container.cpp +++ b/scene/gui/grid_container.cpp @@ -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; |
