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

fix: account for Rectangle fully inside another in intersects method

parent 70d3df9c
......@@ -224,8 +224,14 @@ class SpaceTimeRectangle:
# Other is fully south of self
return False
# Handle east / west edges
return self._test_east_west(other.west) or self._test_east_west(
other.east
return (
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(
......
......@@ -192,8 +192,14 @@ class Rectangle:
# Other is fully south of self
return False
# Handle east / west edges
return self._test_east_west(other.west) or self._test_east_west(
other.east
return (
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(
......
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