From 6b5c89baf7976ebf0a7ce63d8847eb7c0ac7b279 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 15 Oct 2019 14:25:47 +0200 Subject: [PATCH] lv_label_ins_text: consider base dir --- src/lv_objx/lv_label.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lv_objx/lv_label.c b/src/lv_objx/lv_label.c index 069ea9812..4ce18f42f 100644 --- a/src/lv_objx/lv_label.c +++ b/src/lv_objx/lv_label.c @@ -904,7 +904,18 @@ void lv_label_ins_text(lv_obj_t * label, uint32_t pos, const char * txt) pos = lv_txt_get_encoded_length(ext->text); } +#if LV_USE_BIDI + char * bidi_buf = lv_mem_alloc(ins_len) + 1; + LV_ASSERT_MEM(bidi_buf); + if(bidi_buf == NULL) return; + + lv_bidi_process(txt, bidi_buf, lv_obj_get_base_dir(label)); + lv_txt_ins(ext->text, pos, bidi_buf); + + lv_mem_free(bidi_buf); +#else lv_txt_ins(ext->text, pos, txt); +#endif lv_label_refr_text(label); }