@@ -1127,18 +1127,23 @@ static void draw_textArea(nbgl_text_area_t *obj, nbgl_obj_t *prevObj, bool compu
11271127 }
11281128 else {
11291129#ifdef HAVE_SE_TOUCH
1130- uint16_t dotsWidth = nbgl_getSingleLineTextWidth (obj -> fontId , "..." );
11311130 // for last chunk, if nbMaxLines is used, replace the 3 last chars by "..."
1132- // draw line except 3 last chars
1133- if ((lineWidth + dotsWidth ) >= obj -> obj .area .width ) {
1134- lineLen -= 3 ;
1135- }
1136- nbgl_drawText (& rectArea , text , lineLen , obj -> fontId , obj -> textColor );
1137- rectArea .x0 += nbgl_getSingleLineTextWidthInLen (obj -> fontId , text , lineLen );
1131+ // only if the line doesn't end with a '\n'
1132+ if (text [lineLen ] != '\n' ) {
1133+ uint16_t dotsWidth = nbgl_getSingleLineTextWidth (obj -> fontId , "..." );
1134+ if ((lineWidth + dotsWidth ) >= obj -> obj .area .width ) {
1135+ lineLen -= 3 ;
1136+ }
1137+ nbgl_drawText (& rectArea , text , lineLen , obj -> fontId , obj -> textColor );
1138+ rectArea .x0 += nbgl_getSingleLineTextWidthInLen (obj -> fontId , text , lineLen );
11381139
1139- // draw "..." after the other chars
1140- rectArea .width = dotsWidth ;
1141- nbgl_drawText (& rectArea , "..." , 3 , obj -> fontId , obj -> textColor );
1140+ // draw "..." after the other chars
1141+ rectArea .width = dotsWidth ;
1142+ nbgl_drawText (& rectArea , "..." , 3 , obj -> fontId , obj -> textColor );
1143+ }
1144+ else {
1145+ nbgl_drawText (& rectArea , text , lineLen , obj -> fontId , obj -> textColor );
1146+ }
11421147#else // HAVE_SE_TOUCH
11431148 nbgl_drawText (& rectArea , text , lineLen , fontId , obj -> textColor );
11441149#endif // HAVE_SE_TOUCH
0 commit comments