Skip to content

Commit 047e5ec

Browse files
authored
Merge pull request #3189 from makermelissa/main
Fix Eink bonnet weather station for PIL >= 10
2 parents 490c0ba + b4eb6a6 commit 047e5ec

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

EInk_Bonnet_Weather_Station/weather_graphics.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def update_display(self):
102102
draw = ImageDraw.Draw(image)
103103

104104
# Draw the Icon
105-
(font_width, font_height) = icon_font.getsize(self._weather_icon)
105+
(font_width, font_height) = icon_font.getbbox(self._weather_icon)[2:4]
106106
draw.text(
107107
(
108108
self.display.width // 2 - font_width // 2,
@@ -119,7 +119,7 @@ def update_display(self):
119119
)
120120

121121
# Draw the time
122-
(font_width, font_height) = medium_font.getsize(self._time_text)
122+
(font_width, font_height) = medium_font.getbbox(self._time_text)[2:4]
123123
draw.text(
124124
(5, font_height * 2 - 5),
125125
self._time_text,
@@ -128,7 +128,7 @@ def update_display(self):
128128
)
129129

130130
# Draw the main text
131-
(font_width, font_height) = large_font.getsize(self._main_text)
131+
(font_width, font_height) = large_font.getbbox(self._main_text)[2:4]
132132
draw.text(
133133
(5, self.display.height - font_height * 2),
134134
self._main_text,
@@ -137,7 +137,7 @@ def update_display(self):
137137
)
138138

139139
# Draw the description
140-
(font_width, font_height) = small_font.getsize(self._description)
140+
(font_width, font_height) = small_font.getbbox(self._description)[2:4]
141141
draw.text(
142142
(5, self.display.height - font_height - 5),
143143
self._description,
@@ -146,7 +146,7 @@ def update_display(self):
146146
)
147147

148148
# Draw the temperature
149-
(font_width, font_height) = large_font.getsize(self._temperature)
149+
(font_width, font_height) = large_font.getbbox(self._temperature)[2:4]
150150
draw.text(
151151
(
152152
self.display.width - font_width - 5,

0 commit comments

Comments
 (0)