mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
Reduce knob pad get logic
This commit is contained in:
parent
1a41f13fd6
commit
2908a74b42
@ -440,13 +440,13 @@ static void draw_knob(lv_obj_t * rotary, const lv_area_t * clip_area)
|
||||
lv_draw_rect_dsc_t knob_rect_dsc;
|
||||
lv_coord_t center_x = rotary->coords.x1 + r + left_bg;
|
||||
lv_coord_t center_y = rotary->coords.y1 + r + top_bg;
|
||||
|
||||
lv_coord_t knob_inner = lv_obj_get_style_pad_inner(rotary, LV_ROTARY_PART_KNOB)
|
||||
|
||||
if(r > 0) {
|
||||
knob_area.x1 = center_x - r + indic_width + lv_obj_get_style_pad_inner(rotary, LV_ROTARY_PART_KNOB);
|
||||
knob_area.x2 = center_x + r - indic_width - lv_obj_get_style_pad_inner(rotary, LV_ROTARY_PART_KNOB);
|
||||
knob_area.y1 = center_y - r + indic_width + lv_obj_get_style_pad_inner(rotary, LV_ROTARY_PART_KNOB);
|
||||
knob_area.y2 = center_y + r - indic_width - lv_obj_get_style_pad_inner(rotary, LV_ROTARY_PART_KNOB);
|
||||
knob_area.x1 = center_x - r + indic_width + knob_inner;
|
||||
knob_area.x2 = center_x + r - indic_width - knob_inner;
|
||||
knob_area.y1 = center_y - r + indic_width + knob_inner;
|
||||
knob_area.y2 = center_y + r - indic_width - knob_inner;
|
||||
|
||||
lv_draw_rect_dsc_init(&knob_rect_dsc);
|
||||
lv_obj_init_draw_rect_dsc(rotary, LV_ROTARY_PART_KNOB, &knob_rect_dsc);
|
||||
|
Loading…
x
Reference in New Issue
Block a user