mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
label: fix lv_label_get_letter_on if BIDI enabled
This commit is contained in:
parent
6adcdda06a
commit
28f4092247
@ -775,11 +775,16 @@ uint32_t lv_label_get_letter_on(const lv_obj_t * label, lv_point_t * pos)
|
||||
|
||||
#if LV_USE_BIDI
|
||||
/*Handle Bidi*/
|
||||
bool is_rtl;
|
||||
logical_pos = _lv_bidi_get_logical_pos(&txt[line_start], NULL, txt_len, lv_obj_get_base_dir(label),
|
||||
_lv_txt_encoded_get_char_id(bidi_txt, i), &is_rtl);
|
||||
if(is_rtl) logical_pos++;
|
||||
_lv_mem_buf_release(bidi_txt);
|
||||
uint32_t cid = _lv_txt_encoded_get_char_id(bidi_txt, i);
|
||||
if(txt[line_start + cid] == '\0') {
|
||||
logical_pos = i;
|
||||
} else {
|
||||
bool is_rtl;
|
||||
logical_pos = _lv_bidi_get_logical_pos(&txt[line_start], NULL,
|
||||
txt_len, lv_obj_get_base_dir(label), cid, &is_rtl);
|
||||
if(is_rtl) logical_pos++;
|
||||
_lv_mem_buf_release(bidi_txt);
|
||||
}
|
||||
#else
|
||||
logical_pos = _lv_txt_encoded_get_char_id(bidi_txt, i);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user