mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix text processing with negative letter space
This commit is contained in:
parent
71be75b0ec
commit
f54ecc470c
@ -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);
|
||||
cur_w += letter_w;
|
||||
|
||||
if(letter_w > 0) {
|
||||
cur_w += letter_space;
|
||||
}
|
||||
|
||||
/* Test if this character fits within max_width */
|
||||
if(break_index == NO_BREAK_FOUND && cur_w > max_width) {
|
||||
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 */
|
||||
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_next = i_next_next;
|
||||
|
Loading…
x
Reference in New Issue
Block a user