From 702c6d2c3eb43da78958bb8c193209f63f672225 Mon Sep 17 00:00:00 2001 From: ChuckBuilds <33324927+ChuckBuilds@users.noreply.github.com> Date: Fri, 11 Apr 2025 09:59:27 -0500 Subject: [PATCH] changed float to integer --- src/stock_news_manager.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/stock_news_manager.py b/src/stock_news_manager.py index fa908ad4..e6e7ada7 100644 --- a/src/stock_news_manager.py +++ b/src/stock_news_manager.py @@ -214,8 +214,8 @@ class StockNewsManager: total_width = text_width + display_width # Update scroll position with smooth acceleration - scroll_speed = min(self.scroll_speed * 1.1, 3) # Gradually increase speed up to max - self.scroll_position = (self.scroll_position + scroll_speed) % total_width + scroll_speed = min(int(self.scroll_speed * 1.1), 3) # Convert to integer + self.scroll_position = int(self.scroll_position + scroll_speed) % total_width # Clear the display self.display_manager.clear() @@ -223,9 +223,9 @@ class StockNewsManager: # Calculate source and destination regions for efficient blitting if self.scroll_position < display_width: # Text is entering from the right - src_x = text_width - (display_width - self.scroll_position) - src_width = display_width - self.scroll_position - dst_x = self.scroll_position + src_x = int(text_width - (display_width - self.scroll_position)) + src_width = int(display_width - self.scroll_position) + dst_x = int(self.scroll_position) self.display_manager.image.paste( text_image.crop((src_x, 0, src_x + src_width, text_image.height)), (dst_x, 0) @@ -234,7 +234,7 @@ class StockNewsManager: # Text is scrolling off the left src_x = 0 src_width = text_width - dst_x = self.scroll_position - display_width + dst_x = int(self.scroll_position - display_width) self.display_manager.image.paste( text_image.crop((src_x, 0, src_x + src_width, text_image.height)), (dst_x, 0)