diff --git a/src/lv_misc/lv_txt.c b/src/lv_misc/lv_txt.c index c76c486e7..a29a3c158 100644 --- a/src/lv_misc/lv_txt.c +++ b/src/lv_misc/lv_txt.c @@ -534,6 +534,7 @@ static uint32_t lv_txt_unicode_to_utf8(uint32_t letter_uni) */ static uint32_t lv_txt_utf8_conv_wc(uint32_t c) { +#if LV_BIG_ENDIAN_SYSTEM == 0 /*Swap the bytes (UTF-8 is big endian, but the MCUs are little endian)*/ if((c & 0x80) != 0) { uint32_t swapped; @@ -547,7 +548,7 @@ static uint32_t lv_txt_utf8_conv_wc(uint32_t c) } c = swapped; } - +#endif return c; } diff --git a/src/lv_widgets/lv_objmask.c b/src/lv_widgets/lv_objmask.c index e78b1227d..2c817fb17 100644 --- a/src/lv_widgets/lv_objmask.c +++ b/src/lv_widgets/lv_objmask.c @@ -171,6 +171,7 @@ void lv_objmask_remove_mask(lv_obj_t * objmask, lv_objmask_mask_t * mask) else { lv_mem_free(mask->param); _lv_ll_remove(&ext->mask_ll, mask); + lv_mem_free(mask); } lv_obj_invalidate(objmask); diff --git a/src/lv_widgets/lv_roller.c b/src/lv_widgets/lv_roller.c index 314735d14..9a786e25d 100644 --- a/src/lv_widgets/lv_roller.c +++ b/src/lv_widgets/lv_roller.c @@ -123,11 +123,16 @@ lv_obj_t * lv_roller_create(lv_obj_t * par, const lv_obj_t * copy) } /*Copy an existing roller*/ else { + lv_label_create(roller, get_label(copy)); + lv_roller_ext_t * copy_ext = lv_obj_get_ext_attr(copy); lv_roller_set_options(roller, lv_roller_get_options(copy), copy_ext->mode); ext->auto_fit = copy_ext->auto_fit; lv_obj_t * scrl = lv_page_get_scrollable(roller); lv_obj_set_signal_cb(scrl, lv_roller_scrl_signal); + + lv_style_list_copy(&ext->style_sel, ©_ext->style_sel); + lv_obj_refresh_style(roller, LV_STYLE_PROP_ALL); } LV_LOG_INFO("roller created"); diff --git a/src/lv_widgets/lv_textarea.c b/src/lv_widgets/lv_textarea.c index bfdc5af26..182ac55da 100644 --- a/src/lv_widgets/lv_textarea.c +++ b/src/lv_widgets/lv_textarea.c @@ -231,9 +231,17 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c) lv_textarea_ext_t * ext = lv_obj_get_ext_attr(ta); - uint32_t letter_buf[2]; - letter_buf[0] = c; - letter_buf[1] = '\0'; + const char *letter_buf; + + uint32_t u32_buf[2]; + u32_buf[0] = c; + u32_buf[1] = 0; + + letter_buf = (char*)&u32_buf; + +#if LV_BIG_ENDIAN_SYSTEM + if (c != 0) while (*letter_buf == 0) ++letter_buf; +#endif ta_insert_replace = NULL; lv_event_send(ta, LV_EVENT_INSERT, letter_buf); @@ -241,7 +249,7 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c) if(ta_insert_replace[0] == '\0') return; /*Drop this text*/ /*Add the replaced text directly it's different from the original*/ - if(strcmp(ta_insert_replace, (char *)letter_buf)) { + if(strcmp(ta_insert_replace, letter_buf)) { lv_textarea_add_text(ta, ta_insert_replace); return; } @@ -272,7 +280,7 @@ void lv_textarea_add_char(lv_obj_t * ta, uint32_t c) if(txt[0] == '\0') lv_obj_invalidate(ta); } - lv_label_ins_text(ext->label, ext->cursor.pos, (const char *)letter_buf); /*Insert the character*/ + lv_label_ins_text(ext->label, ext->cursor.pos, letter_buf); /*Insert the character*/ lv_textarea_clear_selection(ta); /*Clear selection*/ if(ext->pwd_mode != 0) {