Skip to content

Commit ea1e7a6

Browse files
committed
fix scrolling for scaled text
1 parent a093fc6 commit ea1e7a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

adafruit_matrixportal/matrixportal.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def scroll(self):
361361
return
362362

363363
self._text[self._scrolling_index].x = self._text[self._scrolling_index].x - 1
364-
line_width = self._text[self._scrolling_index].bounding_box[2]
364+
line_width = self._text[self._scrolling_index].bounding_box[2] * self._text_scale[self._scrolling_index]
365365
if self._text[self._scrolling_index].x < -line_width:
366366
# Find the next line
367367
self._scrolling_index = self._get_next_scrollable_text_index()
@@ -376,7 +376,7 @@ def scroll_text(self, frame_delay=0.02):
376376
return
377377
if self._text[self._scrolling_index] is not None:
378378
self._text[self._scrolling_index].x = self.graphics.display.width
379-
line_width = self._text[self._scrolling_index].bounding_box[2]
379+
line_width = self._text[self._scrolling_index].bounding_box[2] * self._text_scale[self._scrolling_index]
380380
for _ in range(self.graphics.display.width + line_width + 1):
381381
self.scroll()
382382
sleep(frame_delay)

0 commit comments

Comments
 (0)