diff --git a/adafruit_display_text/label.py b/adafruit_display_text/label.py index 486a14f..f87dc17 100755 --- a/adafruit_display_text/label.py +++ b/adafruit_display_text/label.py @@ -130,8 +130,6 @@ def __init__( self._padding_left = padding_left self._padding_right = padding_right - self._scale = scale - if text is not None: self._update_text(str(text)) if (anchored_position is not None) and (anchor_point is not None): @@ -389,12 +387,11 @@ def text(self, new_text): @property def scale(self): """Set the scaling of the label, in integer values""" - return self._scale + return self.local_group.scale @scale.setter def scale(self, new_scale): current_anchored_position = self.anchored_position - self._scale = new_scale self.local_group.scale = new_scale self.anchored_position = current_anchored_position @@ -438,13 +435,13 @@ def anchored_position(self): return ( int( self.x - + (self._boundingbox[0] * self._scale) - + round(self._anchor_point[0] * self._boundingbox[2] * self._scale) + + (self._boundingbox[0] * self.scale) + + round(self._anchor_point[0] * self._boundingbox[2] * self.scale) ), int( self.y - + (self._boundingbox[1] * self._scale) - + round(self._anchor_point[1] * self._boundingbox[3] * self._scale) + + (self._boundingbox[1] * self.scale) + + round(self._anchor_point[1] * self._boundingbox[3] * self.scale) ), ) @@ -454,11 +451,11 @@ def anchored_position(self, new_position): return # Note: anchor_point must be set before setting anchored_position self.x = int( new_position[0] - - (self._boundingbox[0] * self._scale) - - round(self._anchor_point[0] * (self._boundingbox[2] * self._scale)) + - (self._boundingbox[0] * self.scale) + - round(self._anchor_point[0] * (self._boundingbox[2] * self.scale)) ) self.y = int( new_position[1] - - (self._boundingbox[1] * self._scale) - - round(self._anchor_point[1] * self._boundingbox[3] * self._scale) + - (self._boundingbox[1] * self.scale) + - round(self._anchor_point[1] * self._boundingbox[3] * self.scale) )