mirror of
https://github.com/meshtastic/firmware.git
synced 2025-06-10 07:02:11 +00:00
Better alignment for banner notifications
This commit is contained in:
parent
572b2de504
commit
6746fe2387
@ -106,8 +106,11 @@ void NotificationRenderer::drawAlertBannerOverlay(OLEDDisplay *display, OLEDDisp
|
|||||||
|
|
||||||
// loop through lines finding \n characters
|
// loop through lines finding \n characters
|
||||||
while ((lineCount < 10) && (lineStarts[lineCount] < alertEnd)) {
|
while ((lineCount < 10) && (lineStarts[lineCount] < alertEnd)) {
|
||||||
lineStarts[lineCount + 1] = std::find(lineStarts[lineCount], alertEnd, '\n') + 1;
|
lineStarts[lineCount + 1] = std::find(lineStarts[lineCount], alertEnd, '\n');
|
||||||
lineLengths[lineCount] = lineStarts[lineCount + 1] - lineStarts[lineCount];
|
lineLengths[lineCount] = lineStarts[lineCount + 1] - lineStarts[lineCount];
|
||||||
|
if (lineStarts[lineCount + 1][0] == '\n') {
|
||||||
|
lineStarts[lineCount + 1] += 1; // Move the start pointer beyond the \n
|
||||||
|
}
|
||||||
lineWidths[lineCount] = display->getStringWidth(lineStarts[lineCount], lineLengths[lineCount], true);
|
lineWidths[lineCount] = display->getStringWidth(lineStarts[lineCount], lineLengths[lineCount], true);
|
||||||
if (lineWidths[lineCount] > maxWidth) {
|
if (lineWidths[lineCount] > maxWidth) {
|
||||||
maxWidth = lineWidths[lineCount];
|
maxWidth = lineWidths[lineCount];
|
||||||
|
Loading…
Reference in New Issue
Block a user