From 4ab4d14a4ec956d462f3b55b2b1e5639fcc2d93c Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Sun, 27 Jul 2025 12:42:12 -0500 Subject: [PATCH] adjusting news manager scroll speed --- src/news_manager.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/news_manager.py b/src/news_manager.py index 26c76d6c..9d6943fc 100644 --- a/src/news_manager.py +++ b/src/news_manager.py @@ -336,6 +336,9 @@ class NewsManager: # Calculate scroll position for smooth animation if self.total_scroll_width > 0: + # Use modulo for continuous scrolling like stock ticker + self.scroll_position = (self.scroll_position + self.scroll_speed) % self.total_scroll_width + # Scroll from right to left x_pos = width - self.scroll_position @@ -346,12 +349,8 @@ class NewsManager: if x_pos + self.total_scroll_width < width: draw.text((x_pos + self.total_scroll_width, y_pos), self.cached_text, font=font, fill=self.text_color) - # Update scroll position - self.scroll_position += self.scroll_speed - - # Reset scroll when text has completely passed - if self.scroll_position >= self.total_scroll_width: - self.scroll_position = 0 + # Check if we should rotate headlines (when scroll wraps around) + if self.scroll_position == 0: self.rotation_count += 1 # Check if we should rotate headlines