Skip to content

Commit 9fa02f6

Browse files
authored
Merge pull request #36 from makermelissa/master
Handle scrolling labels better if position not specified
2 parents 6646a23 + 903fa46 commit 9fa02f6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

adafruit_matrixportal/matrixportal.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,11 @@ def add_text(
179179
text_scale = 1
180180
text_scale = round(text_scale)
181181
if scrolling:
182-
text_position = (self.display.width, text_position[1])
182+
if text_position is None:
183+
# Center text if position not specified
184+
text_position = (self.display.width, self.display.height // 2 - 1)
185+
else:
186+
text_position = (self.display.width, text_position[1])
183187

184188
gc.collect()
185189

0 commit comments

Comments
 (0)