add helper method to get max size
This commit is contained in:
parent
3b6eb6c43b
commit
273ace7693
|
@ -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))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue