Skip to content

Commit 7ba1ae7

Browse files
committed
Replace getsize function with getbbox
1 parent e1a8d84 commit 7ba1ae7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/ssd1306_pillow_demo.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161

6262
# Draw Some Text
6363
text = "Hello World!"
64-
(font_width, font_height) = font.getsize(text)
64+
bbox = font.getbbox(text)
65+
(font_width, font_height) = bbox[2] - bbox[0], bbox[3] - bbox[1]
6566
draw.text(
6667
(oled.width // 2 - font_width // 2, oled.height // 2 - font_height // 2),
6768
text,

0 commit comments

Comments
 (0)