Skip to content

Commit fe1c207

Browse files
committed
SharpDisplay demo: Always use anchor_point/anchored_position
Between adafruit_display_text release 2.8.0 on July 24 and the current version, the behavior of specifying just x/y changed. The same code works with both versions if anchor_point / anchored_position is specified.
1 parent e85939b commit fe1c207

File tree

1 file changed

+3
-3
lines changed
  • CircuitPython_SharpDisplay_Displayio

1 file changed

+3
-3
lines changed

CircuitPython_SharpDisplay_Displayio/code.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,9 @@ def sample(population, k):
166166
# Create a 3 line set of text for BLM
167167
blm_font = [None, None, None]
168168
for line in range(3):
169-
label = adafruit_display_text.label.Label(
170-
font, color=0xFFFFFF, x=8, y=line * 84+12, max_glyphs=16,
171-
)
169+
label = adafruit_display_text.label.Label(font, color=0xFFFFFF, max_glyphs=16)
170+
label.anchor_point = (0, 0)
171+
label.anchored_position = (8, line*84+8)
172172
blm_font[line] = label
173173
blm_group.append(label)
174174

0 commit comments

Comments
 (0)