From 0921dfc8cd9d00e70ead8cbef8a898711af8f43e Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 18 Jan 2022 11:25:15 +0100 Subject: [PATCH] fix(switch): make knob height calculation similar to slider That is use the switch's full height without padding as default knob height --- src/widgets/lv_switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/lv_switch.c b/src/widgets/lv_switch.c index ced76fcf0..dd8979252 100644 --- a/src/widgets/lv_switch.c +++ b/src/widgets/lv_switch.c @@ -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);