fix(textarea, spinbox) fix cursor position and size
This commit is contained in:
@@ -926,7 +926,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
lv_obj_add_style(obj, &styles->pad_small, 0);
|
||||
lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY);
|
||||
lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_CURSOR | LV_STATE_FOCUSED);
|
||||
lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_CURSOR);
|
||||
}
|
||||
#endif
|
||||
#if LV_USE_TILEVIEW
|
||||
|
||||
@@ -1101,8 +1101,8 @@ static void refr_cursor_area(lv_obj_t * obj)
|
||||
lv_area_t cur_area;
|
||||
cur_area.x1 = letter_pos.x - left;
|
||||
cur_area.y1 = letter_pos.y - top;
|
||||
cur_area.x2 = letter_pos.x + right + letter_w;
|
||||
cur_area.y2 = letter_pos.y + bottom + letter_h;
|
||||
cur_area.x2 = letter_pos.x + right + letter_w - 1;
|
||||
cur_area.y2 = letter_pos.y + bottom + letter_h - 1;
|
||||
|
||||
/*Save the new area*/
|
||||
lv_area_t area_tmp;
|
||||
@@ -1311,7 +1311,7 @@ static void draw_cursor(lv_event_t * e)
|
||||
if(cur_dsc.bg_opa == LV_OPA_COVER) {
|
||||
lv_coord_t left = lv_obj_get_style_pad_left(obj, LV_PART_CURSOR);
|
||||
lv_coord_t top = lv_obj_get_style_pad_top(obj, LV_PART_CURSOR);
|
||||
lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_MAIN);
|
||||
lv_coord_t border_width = lv_obj_get_style_border_width(obj, LV_PART_CURSOR);
|
||||
cur_area.x1 += left + border_width;
|
||||
cur_area.y1 += top + border_width;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user