Skip to content

Commit

Permalink
Merge pull request #845 from LedgerHQ/fix-multi-pages-text-containing…
Browse files Browse the repository at this point in the history
…-empty-lines

Fix case when multi-pages text contains '\n' at page break
  • Loading branch information
nroggeman-ledger authored Jan 24, 2025
2 parents 4988724 + 74563e1 commit 8aa0037
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib_nbgl/src/nbgl_step.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ static void displayTextPage(StepContext_t *ctx, uint8_t textPage)
BAGL_FONT_OPEN_SANS_REGULAR_11px_1bpp, txt, AVAILABLE_WIDTH, nbLines, &len, true);
// memorize next position to save processing
ctx->textContext.nextPageStart = txt + len;
// if the next char is '\n', skip it to avoid starting with an empty line
if (*ctx->textContext.nextPageStart == '\n') {
ctx->textContext.nextPageStart++;
}
}
else {
ctx->textContext.nextPageStart = NULL;
Expand Down

0 comments on commit 8aa0037

Please sign in to comment.