From 1018febeab433b7b9a9e4dde59de374d978a4ac7 Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Fri, 10 Mar 2023 22:56:50 -0800 Subject: [PATCH] Fix a bug in Rect.__contains_point! It was comparing point.y with the Rect's min_x. --- erynrl/geometry.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erynrl/geometry.py b/erynrl/geometry.py index 050222f..adc9b90 100644 --- a/erynrl/geometry.py +++ b/erynrl/geometry.py @@ -300,7 +300,7 @@ class Rect: def __contains_point(self, pt: Point) -> bool: return (pt.x >= self.min_x and pt.x <= self.max_x - and pt.y >= self.min_x and pt.y <= self.max_y) + and pt.y >= self.min_y and pt.y <= self.max_y) def __contains_rect(self, other: 'Rect') -> bool: return (self.min_x <= other.min_x