geometry tests

This commit is contained in:
Will McGugan
2022-03-24 15:13:31 +00:00
parent c90a2d42ed
commit 5d98a08933
2 changed files with 9 additions and 5 deletions

View File

@@ -127,11 +127,6 @@ class Size(NamedTuple):
return Region(0, 0, width, height)
def __add__(self, other: object) -> Size:
if isinstance(other, Spacing):
width, height = self
other_width, other_height = other.totals
return Size(width + other_width, height + other_height)
if isinstance(other, tuple):
width, height = self
width2, height2 = other
@@ -617,6 +612,7 @@ class Spacing(NamedTuple):
@property
def totals(self) -> tuple[int, int]:
"""Total spacing for horizontal and vertical spacing."""
top, right, bottom, left = self
return (left + right, top + bottom)