From 903fa4665c29bce3269349479484b61eeac1c4d5 Mon Sep 17 00:00:00 2001 From: Melissa LeBlanc-Williams Date: Fri, 30 Oct 2020 11:46:06 -0700 Subject: [PATCH] Handle scrolling labels better if position not specified --- adafruit_matrixportal/matrixportal.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/adafruit_matrixportal/matrixportal.py b/adafruit_matrixportal/matrixportal.py index 12b48f8..9daa217 100755 --- a/adafruit_matrixportal/matrixportal.py +++ b/adafruit_matrixportal/matrixportal.py @@ -179,7 +179,11 @@ def add_text( text_scale = 1 text_scale = round(text_scale) if scrolling: - text_position = (self.display.width, text_position[1]) + if text_position is None: + # Center text if position not specified + text_position = (self.display.width, self.display.height // 2 - 1) + else: + text_position = (self.display.width, text_position[1]) gc.collect()