X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/blobdiff_plain/03b2e1008f33585652fad5ecedad65d44694b2bc..8dc304ff4f82d37e493b9500e17fb13799dc200f:/displayio/_group.py diff --git a/displayio/_group.py b/displayio/_group.py index b38eaff..903d721 100644 --- a/displayio/_group.py +++ b/displayio/_group.py @@ -21,8 +21,10 @@ from __future__ import annotations from typing import Union, Callable from ._structs import TransformStruct from ._tilegrid import TileGrid +from ._colorspace import Colorspace +from ._area import Area -__version__ = "0.0.0-auto.0" +__version__ = "0.0.0+auto.0" __repo__ = "https://github.com/adafruit/Adafruit_Blinka_displayio.git" @@ -50,6 +52,7 @@ class Group: self._layers = [] self._supported_types = (TileGrid, Group) self._in_group = False + self._item_removed = False self._absolute_transform = TransformStruct(0, 0, 1, 1, 1, False, False, False) self._set_scale(scale) # Set the scale via the setter @@ -141,13 +144,19 @@ class Group: """Deletes the value at the given index.""" del self._layers[index] - def _fill_area(self, buffer): + def _fill_area( + self, colorspace: Colorspace, area: Area, mask: int, buffer: bytearray + ) -> bool: if self._hidden_group: - return + return False for layer in self._layers: if isinstance(layer, (Group, TileGrid)): - layer._fill_area(buffer) # pylint: disable=protected-access + if layer._fill_area( # pylint: disable=protected-access + colorspace, area, mask, buffer + ): + return True + return False def sort(self, key: Callable, reverse: bool) -> None: """Sort the members of the group.""" @@ -158,6 +167,12 @@ class Group: if isinstance(layer, (Group, TileGrid)): layer._finish_refresh() # pylint: disable=protected-access + def _get_refresh_areas(self, areas: list[Area]) -> None: + for layer in self._layers: + if isinstance(layer, (Group, TileGrid)): + if not layer.hidden: + layer._get_refresh_areas(areas) # pylint: disable=protected-access + @property def hidden(self) -> bool: """True when the Group and all of it's layers are not visible. When False, the