fix(slider): fix potential division-by-zero
@@ -212,9 +212,11 @@ static void lv_slider_event(const lv_obj_class_t * class_p, lv_event_t * e)
/*Make the point relative to the indicator*/
new_value = p.x - (obj->coords.x1 + bg_left);
}
+ if(indic_w) {
new_value = (new_value * range) / indic_w;
new_value += slider->bar.min_value;
}
+ }
else {
const lv_coord_t bg_top = lv_obj_get_style_pad_top(obj, LV_PART_MAIN);
const lv_coord_t bg_bottom = lv_obj_get_style_pad_bottom(obj, LV_PART_MAIN);
