File tree Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Expand file tree Collapse file tree 2 files changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ def _reset_text(
264264 # Calculate both "tight" and "loose" bounding box dimensions to match label for
265265 # anchor_position calculations
266266 (
267- box_x ,
267+ box_x , # noqa: F841, var assigned not used
268268 tight_box_y ,
269269 x_offset ,
270270 tight_y_offset ,
@@ -288,8 +288,6 @@ def _reset_text(
288288 y_offset = loose_y_offset
289289
290290 # Calculate the background size including padding
291- tight_box_x = box_x
292- box_x = box_x + self ._padding_left + self ._padding_right
293291 box_y = box_y + self ._padding_top + self ._padding_bottom
294292
295293 if self .dynamic_height :
@@ -343,8 +341,8 @@ def _reset_text(
343341 self ._bounding_box = (
344342 self ._tilegrid .x + self ._padding_left ,
345343 self ._tilegrid .y + self ._padding_top ,
346- tight_box_x ,
347- tight_box_y ,
344+ self . width ,
345+ self . height ,
348346 )
349347
350348 if (
Original file line number Diff line number Diff line change 77
88from adafruit_display_text .text_box import TextBox
99
10+ display = board .DISPLAY
1011main_group = displayio .Group ()
1112
1213left_text = ("Left left left left " * 2 ).rstrip ()
2122 scale = 1 ,
2223)
2324
24- left_text_area .x = 10
25- left_text_area .y = 10
25+ left_text_area .anchor_point = ( 0 , 0 )
26+ left_text_area .anchored_position = ( 0 , 0 )
2627main_group .append (left_text_area )
2728
2829
3839 scale = 1 ,
3940)
4041
41- center_text_area .x = 10
42- center_text_area .y = 10 + left_text_area .height + 10
42+ center_text_area .anchor_point = ( 0.5 , 0.5 )
43+ center_text_area .anchored_position = ( display . width // 2 , display .height // 2 )
4344main_group .append (center_text_area )
4445
4546
5556 scale = 1 ,
5657)
5758
58- right_text_area .x = 10
59- right_text_area .y = center_text_area . y + center_text_area .height + 10
59+ right_text_area .anchor_point = ( 1.0 , 1.0 )
60+ right_text_area .anchored_position = ( display . width , display .height )
6061main_group .append (right_text_area )
6162
6263board .DISPLAY .root_group = main_group
You can’t perform that action at this time.
0 commit comments