Skip to content

Commit

Permalink
Merge pull request #210 from shubham0x13/main
Browse files Browse the repository at this point in the history
Optimize ScrollingLabel update logic to prevent redundant text updates
  • Loading branch information
FoamyGuy authored Nov 2, 2024
2 parents d5222e7 + e25dd28 commit 3ba5f74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion adafruit_display_text/scrolling_label.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ def update(self, force: bool = False) -> None:
self._last_animate_time + int(self.animate_time * 1000), _now
):
if len(self.full_text) <= self.max_characters:
super()._set_text(self.full_text, self.scale)
if self._text != self.full_text:
super()._set_text(self.full_text, self.scale)
self._last_animate_time = _now
return

Expand Down

0 comments on commit 3ba5f74

Please sign in to comment.