Hello
I don’t know if it’s a bug or if it’s desired, but it generate non desired behavior.
In my UI, on lvgl 8.3, I put an arc to control volume.
the arc is only on 120°, not full ring.
but when I click outside of this 120°, the even liked to the arc is called back and the volume is set to 100%, which is a litle too much…
it’s not a touch driver issue, it detect well I click outside of the arc.
Is it normal ???
how to prevent this ? I guess I’m not the only one who have this issue.
code :
// Volume
lv_obj_t *volume_label = lv_label_create(lv_scr_act());
lv_label_set_text(volume_label, "Value");
/*Create Volume Arc*/
volume_arc = lv_arc_create(lv_scr_act());
lv_obj_set_size(volume_arc, 225, 225);
// lv_arc_set_rotation(volume_arc, 135);
lv_arc_set_rotation(volume_arc, 210);
lv_obj_set_style_arc_width(volume_arc, 5, LV_PART_MAIN); // Changes background arc width
lv_obj_set_style_arc_width(volume_arc, 6, LV_PART_INDICATOR); // Changes set part width
// lv_arc_set_bg_angles(volume_arc, 0, 270);
lv_arc_set_bg_angles(volume_arc, 0, 120);
lv_arc_set_value(volume_arc, 10);
lv_obj_remove_style(volume_arc, NULL, LV_PART_KNOB); /*Be sure the knob is not displayed*/
lv_obj_center(volume_arc);
lv_obj_add_event_cb(volume_arc, value_changed_event_cb, LV_EVENT_VALUE_CHANGED, volume_label);
and
static void value_changed_event_cb(lv_event_t * e)
{
lv_obj_t * arc = lv_event_get_target(e);
lv_obj_t * label = (lv_obj_t *)lv_event_get_user_data(e);
lv_label_set_text_fmt(label, "%d%%", lv_arc_get_value(arc));
}
thanks in advance for your help.