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

This commit is contained in:
ChuckBuilds
2025-04-12 20:32:24 -05:00
parent 9d80a48588
commit cc5773a47a

View File

@@ -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