mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 05:42:59 +00:00
Fix graphical base positioning and remove old text display
- Removed old text-based bases display code that was still showing - Fixed positioning calculation for graphical bases to center properly - Added bounds checking to prevent bases from overlapping off display - Bases are now properly centered in the odds column with appropriate spacing - Cleaned up baseball live game display to show only count, outs, and graphical bases
This commit is contained in:
@@ -881,19 +881,8 @@ class OddsTickerManager:
|
|||||||
break
|
break
|
||||||
|
|
||||||
if sport == 'baseball':
|
if sport == 'baseball':
|
||||||
# Baseball: Show inning and count
|
|
||||||
inning_half_indicator = "▲" if live_info.get('inning_half') == 'top' else "▼"
|
|
||||||
inning_text = f"{inning_half_indicator}{live_info.get('inning', 1)}"
|
|
||||||
count_text = f"{live_info.get('balls', 0)}-{live_info.get('strikes', 0)}"
|
|
||||||
outs_count = live_info.get('outs', 0)
|
|
||||||
outs_text = f"{outs_count} out" if outs_count == 1 else f"{outs_count} outs"
|
|
||||||
|
|
||||||
day_text = inning_text
|
|
||||||
date_text = count_text
|
|
||||||
time_text = outs_text
|
|
||||||
|
|
||||||
# For baseball, we'll use graphical base indicators instead of text
|
# For baseball, we'll use graphical base indicators instead of text
|
||||||
# Set the odds text to just show the count
|
# Set the odds text to just show the count and outs
|
||||||
away_odds_text = f"Count: {live_info.get('balls', 0)}-{live_info.get('strikes', 0)}"
|
away_odds_text = f"Count: {live_info.get('balls', 0)}-{live_info.get('strikes', 0)}"
|
||||||
home_odds_text = f"Outs: {live_info.get('outs', 0)}"
|
home_odds_text = f"Outs: {live_info.get('outs', 0)}"
|
||||||
|
|
||||||
@@ -1152,11 +1141,15 @@ class OddsTickerManager:
|
|||||||
|
|
||||||
if sport == 'baseball':
|
if sport == 'baseball':
|
||||||
# Calculate position for base indicators (center of the odds column)
|
# Calculate position for base indicators (center of the odds column)
|
||||||
bases_x = current_x - odds_width - h_padding + (odds_width // 2)
|
# Use the current_x position before we move to the next column
|
||||||
|
bases_x = current_x - odds_width + (odds_width // 2)
|
||||||
bases_y = height // 2
|
bases_y = height // 2
|
||||||
|
|
||||||
# Draw the base indicators
|
# Ensure the bases don't go off the edge of the image
|
||||||
self._draw_base_indicators(draw, self._bases_data, bases_x, bases_y)
|
base_diamond_size = 16 # Total size of the diamond (8px spacing * 2)
|
||||||
|
if bases_x - base_diamond_size >= 0 and bases_x + base_diamond_size <= image.width:
|
||||||
|
# Draw the base indicators
|
||||||
|
self._draw_base_indicators(draw, self._bases_data, bases_x, bases_y)
|
||||||
|
|
||||||
# Clear the bases data after drawing
|
# Clear the bases data after drawing
|
||||||
delattr(self, '_bases_data')
|
delattr(self, '_bases_data')
|
||||||
|
|||||||
Reference in New Issue
Block a user