Skip to content

Commit c768ea4

Browse files
committed
Use 'getFontHeight'
1 parent fbb4d5f commit c768ea4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/MicroOLED_Demo/MicroOLED_Demo.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ void printTitle(String title, int font)
321321
oled.setFontType(font);
322322
// Try to set the cursor in the middle of the screen
323323
oled.setCursor(middleX - (oled.getFontWidth() * (title.length()/2)),
324-
middleY - (oled.getFontWidth() / 2));
324+
middleY - (oled.getFontHeight() / 2));
325325
// Print the title:
326326
oled.print(title);
327327
oled.display();

examples/MicroOLED_Demo_I2C/MicroOLED_Demo_I2C.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ void printTitle(String title, int font)
309309
oled.setFontType(font);
310310
// Try to set the cursor in the middle of the screen
311311
oled.setCursor(middleX - (oled.getFontWidth() * (title.length()/2)),
312-
middleY - (oled.getFontWidth() / 2));
312+
middleY - (oled.getFontHeight() / 2));
313313
// Print the title:
314314
oled.print(title);
315315
oled.display();

0 commit comments

Comments
 (0)