Skip to content

Commit

Permalink
Merge pull request #763 from LedgerHQ/fix-too-long-text-shortening-in…
Browse files Browse the repository at this point in the history
…-details

Fix too long text shortening in details
  • Loading branch information
nroggeman-ledger authored Sep 9, 2024
2 parents ac62f3e + 5544a00 commit 3cf221a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib_nbgl/include/nbgl_use_case.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ extern "C" {
* @brief maximum number of lines for value field in review pages
*/
#ifdef TARGET_STAX
#define NB_MAX_LINES_IN_REVIEW 11
#else // TARGET_STAX
#define NB_MAX_LINES_IN_REVIEW 10
#else // TARGET_STAX
#define NB_MAX_LINES_IN_REVIEW 9
#endif // TARGET_STAX

/**
Expand Down
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 3cf221a

Please sign in to comment.