Skip to content

Commit e25dd28

Browse files
committed
Optimize ScrollingLabel update logic to prevent redundant text updates
1 parent d5222e7 commit e25dd28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_display_text/scrolling_label.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def update(self, force: bool = False) -> None:
8686
self._last_animate_time + int(self.animate_time * 1000), _now
8787
):
8888
if len(self.full_text) <= self.max_characters:
89-
super()._set_text(self.full_text, self.scale)
89+
if self._text != self.full_text:
90+
super()._set_text(self.full_text, self.scale)
9091
self._last_animate_time = _now
9192
return
9293

0 commit comments

Comments
 (0)