From: James Carr Date: Sun, 27 Jun 2021 17:18:15 +0000 (+0100) Subject: Set the initial scale of a Group via the setter so that the associated code is run... X-Git-Tag: 0.6.1^2 X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka_Displayio.git/commitdiff_plain/dbb3f437583e0078826f9b6ba17d15555b0c8300 Set the initial scale of a Group via the setter so that the associated code is run. (Closes #60) --- diff --git a/displayio/group.py b/displayio/group.py index 9842b9f..3fd6809 100644 --- a/displayio/group.py +++ b/displayio/group.py @@ -40,7 +40,7 @@ class Group: self._max_size = max_size if not isinstance(scale, int) or scale < 1: raise ValueError("Scale must be >= 1") - self._scale = scale + self._scale = 1 # Use the setter below to actually set the scale self._group_x = x self._group_y = y self._hidden_group = False @@ -48,9 +48,8 @@ class Group: self._supported_types = (TileGrid, Group) self._absolute_transform = None self.in_group = False - self._absolute_transform = Transform( - 0, 0, 1, 1, self._scale, False, False, False - ) + self._absolute_transform = Transform(0, 0, 1, 1, 1, False, False, False) + self.scale = scale # Set the scale via the setter def update_transform(self, parent_transform): """Update the parent transform and child transforms"""