From 324a6718e74490cf3874d7dfc0de88425f2b33b1 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Tue, 22 Nov 2022 17:02:15 +0100 Subject: [PATCH] Fixed popup display text not being rendered --- src/messagepopupdisplay.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/messagepopupdisplay.cpp b/src/messagepopupdisplay.cpp index c847f6a..522de29 100644 --- a/src/messagepopupdisplay.cpp +++ b/src/messagepopupdisplay.cpp @@ -1,5 +1,8 @@ #include "messagepopupdisplay.h" +// system includes +#include + // 3rdparty lib includes #include #include @@ -42,6 +45,8 @@ void MessagePopupDisplay::initOverlay() CPP_UNUSED(right) + tft.setTextFont(4); + tft.drawSunkenRect(leftMargin, topMargin, width, height, color565(240, 240, 240), color565(100, 100, 100), @@ -51,6 +56,7 @@ void MessagePopupDisplay::initOverlay() int x = leftMargin + 5; int y = topMargin + 5; + for (char c : m_message) { if (c == '\n' || x > tft.width() - rightMargin - 10) @@ -61,7 +67,7 @@ void MessagePopupDisplay::initOverlay() if (c != '\n') { - const auto addedWidth = tft.drawChar(tft.decodeUTF8(c), x, y, 4); + const auto addedWidth = tft.drawString(std::string_view{&c, 1}, x, y); x += addedWidth; }