This commit is contained in:
Henry Schimke
2023-01-05 14:03:37 -06:00
parent f425b89510
commit 0185e80090
7 changed files with 15 additions and 15 deletions

View File

@@ -215,6 +215,7 @@ impl BitMatrix {
Ok(((self.bits[offset] >> (x & 0x1f)) & 1) != 0)
}
/// Confusingly returns true if the requested element is out of bounds
pub fn check_in_bounds(&self, x: u32, y: u32) -> bool {
(y as usize * self.row_size + (x as usize / 32)) > self.bits.len()
}