Description
if the size of the object, in my case LED, is less than 20x20, dragging becomes problematic
What MCU/Processor/Board and compiler are you using?
PC
What LVGL version are you using?
v7
What do you want to achieve?
What have you tried so far?
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
lv_obj_t * led1 = lv_led_create(lv_scr_act(), NULL);
lv_obj_set_size(led1, 20, 20);
lv_obj_set_style_local_bg_color(led1,LV_LED_PART_MAIN, LV_STATE_DEFAULT,LV_COLOR_RED);
lv_obj_align(led1, NULL, LV_ALIGN_IN_TOP_LEFT, x_pos, y_pos);
lv_obj_set_event_cb(led1,event_task);
lv_led_set_bright(led1, 255);
void event_task(lv_obj_t * obj, lv_event_t event){
if (event == LV_EVENT_PRESSING){
lv_obj_set_drag (obj, true);
}
else if(event == LV_EVENT_CLICKED) {
lv_obj_del(obj);
}
}
Screenshot and/or video
original video
2020-12-03 12-28-37.zip (1.4 MB)
gif
at the end I changed the size to 10x10, it was no longer possible to drag