From cc5773a47a41bfbe822dfe6b6e85d3eb473174f1 Mon Sep 17 00:00:00 2001 From: ChuckBuilds <33324927+ChuckBuilds@users.noreply.github.com> Date: Sat, 12 Apr 2025 20:32:24 -0500 Subject: [PATCH] Fix overlapping issue in weather display - Add padding between sections to prevent overlap - Adjust x-coordinate calculations to properly space elements - Ensure each section has 14px usable width (16px - 2px padding) - Center elements within their sections for better visual appearance --- src/weather_manager.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/weather_manager.py b/src/weather_manager.py index 8450a41f..b37a0722 100644 --- a/src/weather_manager.py +++ b/src/weather_manager.py @@ -325,11 +325,12 @@ class WeatherManager: # Calculate layout for 64x32 matrix hours_to_show = min(4, len(self.hourly_forecast)) # Show up to 4 hours section_width = 16 # 64/4 = 16 pixels per section + padding = 1 # Add small padding between sections for i in range(hours_to_show): forecast = self.hourly_forecast[i] - x = i * section_width - center_x = x + section_width // 2 + x = i * section_width + padding + center_x = x + (section_width - 2 * padding) // 2 # Draw hour at top - using extra small font hour_text = forecast['hour'] @@ -387,11 +388,12 @@ class WeatherManager: # Calculate layout for 64x32 matrix days_to_show = min(4, len(self.daily_forecast)) # Show up to 4 days section_width = 16 # 64/4 = 16 pixels per section + padding = 1 # Add small padding between sections for i in range(days_to_show): forecast = self.daily_forecast[i] - x = i * section_width - center_x = x + section_width // 2 + x = i * section_width + padding + center_x = x + (section_width - 2 * padding) // 2 # Draw day name at top - using small font day_text = forecast['date'] # Already in "Fri" format