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
 | 
			
		||||
    def mid_x(self) -> int:
 | 
			
		||||
        '''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
 | 
			
		||||
    def mid_y(self) -> int:
 | 
			
		||||
        '''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
 | 
			
		||||
    def max_x(self) -> int:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue