Skip to content

Commit ab179eb

Browse files
authored
Merge pull request #134 from tmillenaar/update_release_workflow
Fix intersects not properly evaluating the bottom of the tile
2 parents 751d3eb + cf7af33 commit ab179eb

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

gridkit-rs/src/tile.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,12 @@ impl TileTraits for Tile {
207207
}
208208

209209
fn intersects(&self, other: &Tile) -> bool {
210-
return !(self.start_id.0 >= (other.start_id.0 + other.nx as i64)
210+
return !(
211+
self.start_id.0 >= (other.start_id.0 + other.nx as i64)
211212
|| (self.start_id.0 + self.nx as i64) <= other.start_id.0
212-
|| self.start_id.1 >= (other.start_id.1 + other.ny as i64)
213-
|| (self.start_id.1 + other.ny as i64) <= other.start_id.1);
213+
|| self.start_id.1 >= (other.start_id.1 + other.ny as i64)
214+
|| (self.start_id.1 + self.ny as i64) <= other.start_id.1
215+
);
214216
}
215217

216218
fn overlap(&self, other: &Tile) -> Result<Tile, String> {

0 commit comments

Comments
 (0)