mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 13:42:59 +00:00
Fix team logo display in all NHL managers - Create separate temporary images for each team logo - Fix logo overwriting issue in scorebug layout - Ensure both home and away logos are visible
This commit is contained in:
@@ -238,19 +238,21 @@ class BaseNHLManager:
|
|||||||
if home_logo:
|
if home_logo:
|
||||||
home_x = 3 * self.display_width // 4 - home_logo.width // 2
|
home_x = 3 * self.display_width // 4 - home_logo.width // 2
|
||||||
home_y = self.display_height // 4 - home_logo.height // 2
|
home_y = self.display_height // 4 - home_logo.height // 2
|
||||||
temp_img = Image.new('RGB', (self.display_width, self.display_height), 'black')
|
# Create a temporary image for the home logo
|
||||||
temp_draw = ImageDraw.Draw(temp_img)
|
home_temp = Image.new('RGB', (self.display_width, self.display_height), 'black')
|
||||||
temp_img.paste(home_logo, (home_x, home_y), home_logo)
|
home_temp.paste(home_logo, (home_x, home_y), home_logo)
|
||||||
img.paste(temp_img, (0, 0))
|
# Paste the home logo onto the main image
|
||||||
|
img.paste(home_temp, (0, 0))
|
||||||
|
|
||||||
# Draw away team logo (left side)
|
# Draw away team logo (left side)
|
||||||
if away_logo:
|
if away_logo:
|
||||||
away_x = self.display_width // 4 - away_logo.width // 2
|
away_x = self.display_width // 4 - away_logo.width // 2
|
||||||
away_y = self.display_height // 4 - away_logo.height // 2
|
away_y = self.display_height // 4 - away_logo.height // 2
|
||||||
temp_img = Image.new('RGB', (self.display_width, self.display_height), 'black')
|
# Create a temporary image for the away logo
|
||||||
temp_draw = ImageDraw.Draw(temp_img)
|
away_temp = Image.new('RGB', (self.display_width, self.display_height), 'black')
|
||||||
temp_img.paste(away_logo, (away_x, away_y), away_logo)
|
away_temp.paste(away_logo, (away_x, away_y), away_logo)
|
||||||
img.paste(temp_img, (0, 0))
|
# Paste the away logo onto the main image
|
||||||
|
img.paste(away_temp, (0, 0))
|
||||||
|
|
||||||
# Draw scores in the format "AWAY - HOME"
|
# Draw scores in the format "AWAY - HOME"
|
||||||
home_score = str(self.current_game["home_score"])
|
home_score = str(self.current_game["home_score"])
|
||||||
|
|||||||
Reference in New Issue
Block a user