diff --git a/src/ui/basics.rs b/src/ui/basics.rs index 5f71d2b..e9b17c6 100644 --- a/src/ui/basics.rs +++ b/src/ui/basics.rs @@ -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}