This commit is contained in:
Gabor Kiss-Vamosi
2019-12-14 10:49:10 +01:00

View File

@@ -200,6 +200,10 @@ static uint16_t lv_txt_get_next_word(const char * txt, const lv_font_t * font,
letter_w = lv_font_get_glyph_width(font, letter, letter_next); letter_w = lv_font_get_glyph_width(font, letter, letter_next);
cur_w += letter_w; cur_w += letter_w;
if(letter_w > 0) {
cur_w += letter_space;
}
/* Test if this character fits within max_width */ /* Test if this character fits within max_width */
if(break_index == NO_BREAK_FOUND && cur_w > max_width) { if(break_index == NO_BREAK_FOUND && cur_w > max_width) {
break_index = i; break_index = i;
@@ -219,9 +223,6 @@ static uint16_t lv_txt_get_next_word(const char * txt, const lv_font_t * font,
/* Update the output width */ /* Update the output width */
if( word_w_ptr != NULL && break_index == NO_BREAK_FOUND ) *word_w_ptr = cur_w; if( word_w_ptr != NULL && break_index == NO_BREAK_FOUND ) *word_w_ptr = cur_w;
if(letter_w > 0) {
cur_w += letter_space;
}
i = i_next; i = i_next;
i_next = i_next_next; i_next = i_next_next;