diff --git a/src/graphics/draw/MessageRenderer.cpp b/src/graphics/draw/MessageRenderer.cpp index 55be857f0..ca14b1556 100644 --- a/src/graphics/draw/MessageRenderer.cpp +++ b/src/graphics/draw/MessageRenderer.cpp @@ -278,7 +278,7 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 // Cache miss - regenerate lines and heights cachedLines = generateLines(display, headerStr, messageBuf, textWidth); cachedHeights = - calculateLineHeights(display, cachedLines, emotes, numEmotes); + calculateLineHeights(cachedLines, emotes); cachedKey = currentKey; } @@ -345,7 +345,9 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 std::vector generateLines(OLEDDisplay *display, const char *headerStr, - const char *messageBuf, int textWidth) { + const char *messageBuf, + int textWidth) +{ std::vector lines; lines.push_back(std::string(headerStr)); // Header line is always first @@ -390,9 +392,9 @@ std::vector generateLines(OLEDDisplay *display, return lines; } -std::vector calculateLineHeights(OLEDDisplay *display, - const std::vector &lines, - const Emote *emotes, int emoteCount) { +std::vector calculateLineHeights(const std::vector& lines, + const Emote *emotes) +{ std::vector rowHeights; for (const auto &_line : lines) { @@ -421,15 +423,16 @@ std::vector calculateLineHeights(OLEDDisplay *display, } void renderMessageContent(OLEDDisplay *display, - const std::vector &lines, - const std::vector &rowHeights, + const std::vector& lines, + const std::vector& rowHeights, int x, int yOffset, int scrollBottom, const Emote *emotes, int numEmotes, bool isInverted, - bool isBold) { + bool isBold) +{ for (size_t i = 0; i < lines.size(); ++i) { int lineY = yOffset; for (size_t j = 0; j < i; ++j) diff --git a/src/graphics/draw/MessageRenderer.h b/src/graphics/draw/MessageRenderer.h index ed592d20f..2809254d3 100644 --- a/src/graphics/draw/MessageRenderer.h +++ b/src/graphics/draw/MessageRenderer.h @@ -19,17 +19,17 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16 // Function to generate lines with word wrapping std::vector generateLines(OLEDDisplay *display, const char *headerStr, - const char *messageBuf, int textWidth); + const char *messageBuf, + int textWidth); // Function to calculate heights for each line -std::vector calculateLineHeights(OLEDDisplay *display, - const std::vector &lines, - const Emote *emotes, int emoteCount); +std::vector calculateLineHeights(const std::vector& lines, + const Emote *emotes); // Function to render the message content void renderMessageContent(OLEDDisplay *display, - const std::vector &lines, - const std::vector &rowHeights, + const std::vector& lines, + const std::vector& rowHeights, int x, int yOffset, int scrollBottom,