cell grid robust against null dimensions
Signed-off-by: Fabrizio Iannetti <fabrizio.iannetti@gmail.com>
This commit is contained in:
parent
6fb0761911
commit
c805cc94d3
|
@ -38,8 +38,8 @@ impl CellGrid {
|
|||
y,
|
||||
width,
|
||||
height,
|
||||
num_x,
|
||||
num_y,
|
||||
num_x: if num_y > 0 { num_x } else { 0 }, // if one dimension is 0, both shall be 0
|
||||
num_y: if num_x > 0 { num_y } else { 0 }, // if one dimension is 0, both shall be 0
|
||||
pos_x: 0,
|
||||
pos_y: 0,
|
||||
curr: Cell {x, y, width, height, pos_x: 0, pos_y: 0}
|
||||
|
|
Loading…
Reference in New Issue