Skip to content

Commit

Permalink
fix(switch): make knob height calculation similar to slider
Browse files Browse the repository at this point in the history
That is use the switch's full height without padding as default knob height
  • Loading branch information
kisvegabor committed Jan 18, 2022
1 parent 1df510e commit 0921dfc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/widgets/lv_switch.c
Expand Up @@ -193,8 +193,8 @@ static void draw_main(lv_event_t * e)
knob_area.x1 = obj->coords.x1 + bg_left + anim_value_x;
knob_area.x2 = knob_area.x1 + knob_size;

knob_area.y1 = obj->coords.y1 + bg_top;
knob_area.y2 = obj->coords.y2 - bg_bottom;
knob_area.y1 = obj->coords.y1;
knob_area.y2 = obj->coords.y2;

lv_coord_t knob_left = lv_obj_get_style_pad_left(obj, LV_PART_KNOB);
lv_coord_t knob_right = lv_obj_get_style_pad_right(obj, LV_PART_KNOB);
Expand Down

0 comments on commit 0921dfc

Please sign in to comment.