From b79d615ae82a1b9fa1352bf2af83244fa673a018 Mon Sep 17 00:00:00 2001 From: iDalink <934367813@qq.com> Date: Wed, 11 Nov 2020 19:29:51 +0800 Subject: [PATCH] look ahead chars when be in LV_LABEL_LONG_DOT (#1881) Co-authored-by: Dalink Co-authored-by: Gabor Kiss-Vamosi --- CHANGELOG.md | 1 + src/lv_widgets/lv_label.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d46635a6..eb56b17d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - fix(draw_triangle): fix polygon/triangle drawing when the order of points is counter-clockwise - fix(btnmatrix): fix setting the same map with modified pointers - fix(arc) fix and improve arc dragging +- label: Repair calculate back `dot` character logical error which cause infinite loop. ## v7.7.1 (04.11.2020) ### Bugfixes diff --git a/src/lv_widgets/lv_label.c b/src/lv_widgets/lv_label.c index d56b4cbd5..865a8f02b 100644 --- a/src/lv_widgets/lv_label.c +++ b/src/lv_widgets/lv_label.c @@ -1191,7 +1191,7 @@ void lv_label_refr_text(lv_obj_t * label) size_t txt_len = strlen(ext->text); uint32_t byte_id = _lv_txt_encoded_get_byte_id(ext->text, letter_id); while(byte_id + LV_LABEL_DOT_NUM > txt_len) { - byte_id -= _lv_txt_encoded_size(&ext->text[byte_id]); + _lv_txt_encoded_prev(ext->text, &byte_id); letter_id--; }