Use integer division for Rect.mid_y and Rect.mid_x
This commit is contained in:
parent
7b0b7ff5b6
commit
727a0737c6
1 changed files with 2 additions and 2 deletions
|
@ -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:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue