removed same_size

This commit is contained in:
Will McGugan
2023-01-09 10:41:04 +00:00
parent 204f3e48ed
commit 3ac98187f9
2 changed files with 1 additions and 16 deletions

View File

@@ -276,10 +276,7 @@ class Compositor:
resized_widgets = {
widget
for widget, (region, *_) in changes
if (
widget in common_widgets
and not old_map[widget].region.same_size(region)
)
if (widget in common_widgets and old_map[widget].region[2:] != region[2:])
}
screen_region = size.region

View File

@@ -541,18 +541,6 @@ class Region(NamedTuple):
width2, height2 = size
return Region(x, y, min(width1, width2), min(height1, height2))
def same_size(self, region: Region) -> bool:
"""Check if another region is the same size. Equivalent to `self.size == region.size`,
but a little faster.
Args:
region (Region): A region.
Returns:
bool: True if both regions are the same size, False if they are different sizes.
"""
return self[2:] == region[2:]
def expand(self, size: tuple[int, int]) -> Region:
"""Increase the size of the region by adding a border.