mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
Fix NHL logo pasting in NHLLiveManager - Remove incorrect use of temp_draw.im.paste() - Use proper Image.paste() method for logo compositing - Fix alpha channel handling in logo pasting
This commit is contained in:
@@ -166,8 +166,8 @@ class BaseNHLManager:
|
||||
home_y = self.display_height // 4 - home_logo.height // 2
|
||||
temp_img = Image.new('RGB', (self.display_width, self.display_height), 'black')
|
||||
temp_draw = ImageDraw.Draw(temp_img)
|
||||
temp_draw.im.paste(home_logo, (home_x, home_y), home_logo)
|
||||
draw.im.paste(temp_img, (0, 0))
|
||||
temp_img.paste(home_logo, (home_x, home_y), home_logo)
|
||||
img.paste(temp_img, (0, 0))
|
||||
|
||||
# Draw away team logo
|
||||
if away_logo:
|
||||
@@ -175,8 +175,8 @@ class BaseNHLManager:
|
||||
away_y = 3 * self.display_height // 4 - away_logo.height // 2
|
||||
temp_img = Image.new('RGB', (self.display_width, self.display_height), 'black')
|
||||
temp_draw = ImageDraw.Draw(temp_img)
|
||||
temp_draw.im.paste(away_logo, (away_x, away_y), away_logo)
|
||||
draw.im.paste(temp_img, (0, 0))
|
||||
temp_img.paste(away_logo, (away_x, away_y), away_logo)
|
||||
img.paste(temp_img, (0, 0))
|
||||
|
||||
# Draw scores
|
||||
home_score = str(self.current_game["home_score"])
|
||||
@@ -293,8 +293,8 @@ class NHLLiveManager(BaseNHLManager):
|
||||
home_y = self.display_height // 4 - home_logo.height // 2
|
||||
temp_img = Image.new('RGB', (self.display_width, self.display_height), 'black')
|
||||
temp_draw = ImageDraw.Draw(temp_img)
|
||||
temp_draw.im.paste(home_logo, (home_x, home_y), home_logo)
|
||||
draw.im.paste(temp_img, (0, 0))
|
||||
temp_img.paste(home_logo, (home_x, home_y), home_logo)
|
||||
img.paste(temp_img, (0, 0))
|
||||
|
||||
# Draw away team logo
|
||||
if away_logo:
|
||||
@@ -302,8 +302,8 @@ class NHLLiveManager(BaseNHLManager):
|
||||
away_y = 3 * self.display_height // 4 - away_logo.height // 2
|
||||
temp_img = Image.new('RGB', (self.display_width, self.display_height), 'black')
|
||||
temp_draw = ImageDraw.Draw(temp_img)
|
||||
temp_draw.im.paste(away_logo, (away_x, away_y), away_logo)
|
||||
draw.im.paste(temp_img, (0, 0))
|
||||
temp_img.paste(away_logo, (away_x, away_y), away_logo)
|
||||
img.paste(temp_img, (0, 0))
|
||||
|
||||
# Draw scores
|
||||
home_score = str(self.current_game["home_score"])
|
||||
|
||||
Reference in New Issue
Block a user