ta: fix cursor draw with LV_TXT_UTF8 == 0

This commit is contained in:
Gabor Kiss-Vamosi
2018-12-12 23:45:06 +01:00
parent 86de6f5fbc
commit 6c552e8447

View File

@@ -966,11 +966,12 @@ static bool lv_ta_scrollable_design(lv_obj_t * scrl, const lv_area_t * mask, lv_
uint32_t byte_pos;
#if LV_TXT_UTF8 != 0
byte_pos = lv_txt_encoded_get_byte_id(txt, cur_pos);
uint32_t letter = lv_txt_encoded_next(&txt[byte_pos], NULL);
#else
byte_pos = cur_pos;
uint32_t letter = txt[byte_pos];
#endif
uint32_t letter = lv_txt_encoded_next(&txt[byte_pos], NULL);
lv_coord_t letter_h = lv_font_get_height(label_style->text.font);
/*Set letter_w (set not 0 on non printable but valid chars)*/
lv_coord_t letter_w;
@@ -1003,6 +1004,7 @@ static bool lv_ta_scrollable_design(lv_obj_t * scrl, const lv_area_t * mask, lv_
}
}
/*Draw he cursor according to the type*/
lv_area_t cur_area;
if(ext->cursor.type == LV_CURSOR_LINE) {