From cf7af336644b4e1146391a54c02db5c117cc6084 Mon Sep 17 00:00:00 2001 From: Timo Millenaar Date: Sun, 6 Jul 2025 17:54:22 +0200 Subject: [PATCH] Fix intersects not properly evaluating the bottom of the tile --- gridkit-rs/src/tile.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/gridkit-rs/src/tile.rs b/gridkit-rs/src/tile.rs index 8b321ee0b..2e95ea1ef 100644 --- a/gridkit-rs/src/tile.rs +++ b/gridkit-rs/src/tile.rs @@ -207,10 +207,12 @@ impl TileTraits for Tile { } fn intersects(&self, other: &Tile) -> bool { - return !(self.start_id.0 >= (other.start_id.0 + other.nx as i64) + return !( + self.start_id.0 >= (other.start_id.0 + other.nx as i64) || (self.start_id.0 + self.nx as i64) <= other.start_id.0 - || self.start_id.1 >= (other.start_id.1 + other.ny as i64) - || (self.start_id.1 + other.ny as i64) <= other.start_id.1); + || self.start_id.1 >= (other.start_id.1 + other.ny as i64) + || (self.start_id.1 + self.ny as i64) <= other.start_id.1 + ); } fn overlap(&self, other: &Tile) -> Result {