X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/blobdiff_plain/8c7cf84e5c6cc8ea1c19ed1f9c5f2197bc142762..a48d0f835022730cc570eb210406ea9f8ef2b149:/displayio/group.py diff --git a/displayio/group.py b/displayio/group.py index 3fd6809..e6deba8 100644 --- a/displayio/group.py +++ b/displayio/group.py @@ -46,10 +46,9 @@ class Group: self._hidden_group = False self._layers = [] self._supported_types = (TileGrid, Group) - self._absolute_transform = None self.in_group = False self._absolute_transform = Transform(0, 0, 1, 1, 1, False, False, False) - self.scale = scale # Set the scale via the setter + self._set_scale(scale) # Set the scale via the setter def update_transform(self, parent_transform): """Update the parent transform and child transforms""" @@ -164,6 +163,11 @@ class Group: @scale.setter def scale(self, value): + self._set_scale(value) + + def _set_scale(self, value): + # This is method allows the scale to be set by this class even when + # the scale property is over-ridden by a subclass. if not isinstance(value, int) or value < 1: raise ValueError("Scale must be >= 1") if self._scale != value: