Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix case when multi-pages text contains '\n' at page break #845

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading