1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00

Ensure lv_ta_set_one_line doesn't change text alignment

This commit is contained in:
embeddedt 2020-02-04 08:16:41 -05:00 committed by GitHub
parent 84ed542b34
commit f960c75e3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -733,6 +733,7 @@ void lv_ta_set_one_line(lv_obj_t * ta, bool en)
lv_ta_ext_t * ext = lv_obj_get_ext_attr(ta);
if(ext->one_line == en) return;
lv_label_align_t old_align = lv_ta_get_text_align(ta);
if(en) {
const lv_style_t * style_ta = lv_obj_get_style(ta);
@ -760,7 +761,8 @@ void lv_ta_set_one_line(lv_obj_t * ta, bool en)
}
placeholder_update(ta);
refr_cursor_area(ta);
/* `refr_cursor_area` is called at the end of lv_ta_set_text_align */
lv_ta_set_text_align(ta, old_align);
}
/**