Use text aligns for message layout where necessary

This commit is contained in:
Jason P 2025-10-11 08:56:26 -05:00
parent 1d7fe20520
commit e934f8f0b3

View File

@ -574,9 +574,9 @@ void drawTextMessageFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
} else { } else {
// Render message line // Render message line
if (isMine[i]) { if (isMine[i]) {
int w = display->getStringWidth(cachedLines[i].c_str()); display->setTextAlignment(TEXT_ALIGN_RIGHT);
int rightX = SCREEN_WIDTH - w - 2; drawStringWithEmotes(display, SCREEN_WIDTH, lineY, cachedLines[i], emotes, numEmotes);
drawStringWithEmotes(display, rightX, lineY, cachedLines[i], emotes, numEmotes); display->setTextAlignment(TEXT_ALIGN_LEFT);
} else { } else {
drawStringWithEmotes(display, x, lineY, cachedLines[i], emotes, numEmotes); drawStringWithEmotes(display, x, lineY, cachedLines[i], emotes, numEmotes);
} }