From cef0ee34dc78ee61a41062c4c194ac772a8f391f Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Tue, 9 Apr 2024 19:15:04 +1000 Subject: [PATCH] Fix newline height --- source/Core/Drivers/OLED.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/Core/Drivers/OLED.cpp b/source/Core/Drivers/OLED.cpp index c507e414..09658be1 100644 --- a/source/Core/Drivers/OLED.cpp +++ b/source/Core/Drivers/OLED.cpp @@ -174,12 +174,6 @@ void OLED::drawChar(const uint16_t charCode, const FontStyle fontStyle, const ui case FontStyle::SMALL: case FontStyle::LARGE: default: - if (charCode == '\x01' && cursor_y == 0) { // 0x01 is used as new line char - setCursor(soft_x_limit, 8); - return; - } else if (charCode <= 0x01) { - return; - } currentFont = nullptr; index = 0; switch (fontStyle) { @@ -193,6 +187,12 @@ void OLED::drawChar(const uint16_t charCode, const FontStyle fontStyle, const ui fontWidth = 12; break; } + if (charCode == '\x01' && cursor_y == 0) { // 0x01 is used as new line char + setCursor(soft_x_limit, fontHeight); + return; + } else if (charCode <= 0x01) { + return; + } currentFont = fontStyle == FontStyle::SMALL ? FontSectionInfo.font06_start_ptr : FontSectionInfo.font12_start_ptr; index = charCode - 2;