Use integer division for Rect.mid_y and Rect.mid_x

This commit is contained in:
Eryn Wells 2023-02-10 21:13:49 -08:00
parent 7b0b7ff5b6
commit 727a0737c6

View file

@ -142,12 +142,12 @@ class Rect:
@property @property
def mid_x(self) -> int: def mid_x(self) -> int:
'''The x-value of the center point of this rectangle.''' '''The x-value of the center point of this rectangle.'''
return int(self.origin.x + self.size.width / 2) return self.origin.x + self.size.width // 2
@property @property
def mid_y(self) -> int: def mid_y(self) -> int:
'''The y-value of the center point of this rectangle.''' '''The y-value of the center point of this rectangle.'''
return int(self.origin.y + self.size.height / 2) return self.origin.y + self.size.height // 2
@property @property
def max_x(self) -> int: def max_x(self) -> int: