1
0
Fork 0

add helper method to get max size

This commit is contained in:
Sean Sube 2023-08-20 15:19:07 -05:00
parent 3b6eb6c43b
commit 273ace7693
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 3 additions and 0 deletions

View File

@ -86,6 +86,9 @@ class Size:
border.top + self.height + border.bottom, border.top + self.height + border.bottom,
) )
def max(self, width: int, height: int):
return Size(max(self.width, width), max(self.height, height))
def min(self, width: int, height: int): def min(self, width: int, height: int):
return Size(min(self.width, width), min(self.height, height)) return Size(min(self.width, width), min(self.height, height))