This commit is contained in:
Crispy 2024-10-06 23:37:21 +02:00
parent db7a2b2418
commit 9bee7c0e10
5 changed files with 11 additions and 13 deletions

View file

@ -174,7 +174,7 @@ impl Board {
pub fn grow_to_include(&mut self, p: Pos) {
let p = self.transform(p);
if p.x < 0 {
let len = p.x.abs() as usize;
let len = p.x.unsigned_abs();
for row in &mut self.rows {
let mut new_row = vec![Tile::Blank; len];
new_row.append(row);
@ -191,7 +191,7 @@ impl Board {
}
if p.y < 0 {
let len = p.y.abs() as usize;
let len = p.y.unsigned_abs();
let mut new_rows = vec![vec![Tile::Blank; self.width]; len];
new_rows.append(&mut self.rows);
self.rows = new_rows;