render lines and scrollbars

This commit is contained in:
Will McGugan
2022-07-04 20:37:59 +01:00
parent f3a7c9483f
commit 2ac95c5922
7 changed files with 193 additions and 186 deletions

View File

@@ -459,6 +459,11 @@ class Region(NamedTuple):
height + expand_height * 2,
)
def enlarge(self, size: tuple[int, int]) -> Region:
add_width, add_height = size
x, y, width, height = self
return Region(x, y, width + add_width, height + add_height)
@lru_cache(maxsize=1024)
def overlaps(self, other: Region) -> bool:
"""Check if another region overlaps this region.