@@ -49,25 +49,24 @@ class Label(displayio.Group):
49
49
Must include a capital M for measuring character size.
50
50
:param str text: Text to display
51
51
:param int max_glyphs: Unnecessary parameter (provided only for direct compability
52
- with label.py)
52
+ with label.py)
53
53
:param int color: Color of all text in RGB hex
54
54
:param int background_color: Color of the background, use `None` for transparent
55
55
:param double line_spacing: Line spacing of text to display
56
56
:param boolean background_tight: Set `True` only if you want background box to tightly
57
- surround text
57
+ surround text
58
58
:param int padding_top: Additional pixels added to background bounding box at top
59
59
:param int padding_bottom: Additional pixels added to background bounding box at bottom
60
60
:param int padding_left: Additional pixels added to background bounding box at left
61
61
:param int padding_right: Additional pixels added to background bounding box at right
62
62
:param (double,double) anchor_point: Point that anchored_position moves relative to.
63
- Tuple with decimal percentage of width and height.
64
- (E.g. (0,0) is top left, (1.0, 0.5): is middle right.)
63
+ Tuple with decimal percentage of width and height.
64
+ (E.g. (0,0) is top left, (1.0, 0.5): is middle right.)
65
65
:param (int,int) anchored_position: Position relative to the anchor_point. Tuple
66
- containing x,y pixel coordinates.
66
+ containing x,y pixel coordinates.
67
67
:param int scale: Integer value of the pixel scaling
68
68
:param bool save_text: Set True to save the text string as a constant in the
69
- label structure. Set False to reduce memory use.
70
- """
69
+ label structure. Set False to reduce memory use."""
71
70
72
71
# pylint: disable=unused-argument, too-many-instance-attributes, too-many-locals, too-many-arguments
73
72
# pylint: disable=too-many-branches, no-self-use, too-many-statements
@@ -185,15 +184,11 @@ def _reset_text(
185
184
if padding_right is not None :
186
185
self ._padding_right = max (0 , padding_right )
187
186
if anchor_point is not None :
188
- self .anchor_point = anchor_point
187
+ self ._anchor_point = anchor_point
189
188
if anchored_position is not None :
190
189
self ._anchored_position = anchored_position
191
190
if save_text is not None :
192
191
self ._save_text = save_text
193
- if (
194
- scale is not None
195
- ): # Scale will be defined in local_group (Note: self should have scale=1)
196
- self .scale = scale # call the setter
197
192
198
193
# if text is not provided as a parameter (text is None), use the previous value.
199
194
if (text is None ) and self ._save_text :
@@ -298,6 +293,11 @@ def _reset_text(
298
293
tight_box_y ,
299
294
)
300
295
296
+ if (
297
+ scale is not None
298
+ ): # Scale will be defined in local_group (Note: self should have scale=1)
299
+ self .scale = scale # call the setter
300
+
301
301
self .anchored_position = (
302
302
self ._anchored_position
303
303
) # set the anchored_position with setter after bitmap is created, sets the
0 commit comments