File tree 1 file changed +10
-2
lines changed
CircuitPython_SharpDisplay_Displayio 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -231,7 +231,15 @@ def sample(population, k):
231
231
print (name )
232
232
lines = name .split (" " )
233
233
with BatchDisplayUpdate (display ):
234
- names_font [0 ].text = lines [0 ]
235
- names_font [1 ].text = lines [1 ]
234
+ for i in range (2 ):
235
+ names_font [i ].text = lines [i ]
236
+
237
+ # Due to a bug in adafruit_display_text, we need to reestablish
238
+ # the position of the labels when updating them.
239
+ # Once https://github.com/adafruit/Adafruit_CircuitPython_Display_Text/issues/82
240
+ # has been resolved, this code will no longer be necessary (but
241
+ # will not be harmful either)
242
+ names_font [i ].anchor_point = (0.5 , 0 )
243
+ names_font [i ].anchored_position = (200 , i * 84 + 42 )
236
244
time .sleep (5 )
237
245
names_font [0 ].text = names_font [1 ].text = ""
You can’t perform that action at this time.
0 commit comments