Commit cfdb2d7e authored by Joseph Siddons's avatar Joseph Siddons
Browse files

fix: account for Rectangle fully inside another in intersects method

...@@ -224,8 +224,14 @@ class SpaceTimeRectangle: ...@@ -224,8 +224,14 @@ class SpaceTimeRectangle:
# Other is fully south of self # Other is fully south of self
return False return False
# Handle east / west edges # Handle east / west edges
return self._test_east_west(other.west) or self._test_east_west( return (
other.east self._test_east_west(other.west)
or self._test_east_west(other.east)
# Fully contained within other
or (
other._test_east_west(self.west)
and other._test_east_west(self.east)
)
) )
def nearby( def nearby(
......
...@@ -192,8 +192,14 @@ class Rectangle: ...@@ -192,8 +192,14 @@ class Rectangle:
# Other is fully south of self # Other is fully south of self
return False return False
# Handle east / west edges # Handle east / west edges
return self._test_east_west(other.west) or self._test_east_west( return (
other.east self._test_east_west(other.west)
or self._test_east_west(other.east)
# Fully contained within other
or (
other._test_east_west(self.west)
and other._test_east_west(self.east)
)
) )
def nearby( def nearby(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment