Skip to content

Commit

Permalink
Fix wrong word cutting at the end of some too long text in details
Browse files Browse the repository at this point in the history
(cherry picked from commit 5544a00)
  • Loading branch information
nroggeman-ledger authored and cedelavergne-ledger committed Sep 9, 2024
1 parent c2620f3 commit 8262712
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib_nbgl/src/nbgl_fonts.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,10 @@ bool nbgl_getTextMaxLenInNbLines(nbgl_font_id_e fontId,
// if \n, reset width
if (unicode == '\n') {
maxNbLines--;
// if last line is reached, let's rewind before carriage return
if (maxNbLines == 0) {
text--;
}
width = 0;
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion lib_nbgl/src/nbgl_use_case.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ static const char *getDetailsPageAt(uint8_t detailsPage)
AVAILABLE_WIDTH,
NB_MAX_LINES_IN_DETAILS,
&len,
false);
detailsContext.wrapping);
len -= 3;
currentChar = currentChar + len;
}
Expand Down

0 comments on commit 8262712

Please sign in to comment.