Skip to content

Commit

Permalink
Fix crash with grid_mode and no objects
Browse files Browse the repository at this point in the history
Regression of d0a3380
  • Loading branch information
speleo3 committed Sep 1, 2023
1 parent 5622d76 commit 3287c61
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions layer1/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ void GridUpdate(GridInfo * I, float asp_ratio, GridMode mode, int size)

// the above algorithm can generate a 3x2 grid for size=4, but we want a
// 2x2 in that case.
while ((n_col - 1) * n_row >= size) {
while ((n_col - 1) * n_row >= size && size) {
n_col -= 1;
}
while ((n_row - 1) * n_col >= size) {
while ((n_row - 1) * n_col >= size && size) {
n_row -= 1;
}

Expand Down

0 comments on commit 3287c61

Please sign in to comment.