port DefaultGridSampler

This commit is contained in:
Henry Schimke
2023-03-08 14:36:43 -06:00
parent 717b74fd99
commit e1332c8010
6 changed files with 164 additions and 81 deletions

View File

@@ -695,6 +695,10 @@ impl BitMatrix {
new_bm
}
pub fn is_in(&self, p: Point) -> bool {
self.isIn(p, 0)
}
pub fn isIn(&self, p: Point, b: i32) -> bool {
b as f32 <= p.x
&& p.x < self.getWidth() as f32 - b as f32