Merge branch 'master' into dev-5.3

This commit is contained in:
Gabor Kiss-Vamosi
2018-11-11 19:56:44 +01:00
2 changed files with 11 additions and 8 deletions

View File

@@ -585,7 +585,10 @@ static void indev_proc_press(lv_indev_proc_t * proc)
if(proc->reset_query != 0) return;
}
if(pr_obj != NULL) {
proc->act_obj = pr_obj; /*Save the pressed object*/
proc->last_obj = proc->act_obj; /*Refresh the last_obj*/
if(proc->act_obj != NULL) {
/* Save the time when the obj pressed.
* It is necessary to count the long press time.*/
proc->pr_timestamp = lv_tick_get();
@@ -598,7 +601,7 @@ static void indev_proc_press(lv_indev_proc_t * proc)
proc->vect.y = 0;
/*Search for 'top' attribute*/
lv_obj_t * i = pr_obj;
lv_obj_t * i = proc->act_obj;
lv_obj_t * last_top = NULL;
while(i != NULL) {
if(i->top != 0) last_top = i;
@@ -614,14 +617,11 @@ static void indev_proc_press(lv_indev_proc_t * proc)
}
/*Send a signal about the press*/
pr_obj->signal_func(pr_obj, LV_SIGNAL_PRESSED, indev_act);
proc->act_obj->signal_func(proc->act_obj, LV_SIGNAL_PRESSED, indev_act);
if(proc->reset_query != 0) return;
}
}
proc->act_obj = pr_obj; /*Save the pressed object*/
proc->last_obj = proc->act_obj; /*Refresh the last_obj*/
/*Calculate the vector*/
proc->vect.x = proc->act_point.x - proc->last_point.x;
proc->vect.y = proc->act_point.y - proc->last_point.y;

View File

@@ -360,10 +360,13 @@ lv_res_t lv_obj_del(lv_obj_t * obj)
void lv_obj_clean(lv_obj_t * obj)
{
lv_obj_t * child = lv_obj_get_child(obj, NULL);
lv_obj_t * child_next;
while(child) {
/* Read the next child before deleting the current
* because the next couldn't be read from a deleted (invalid) node*/
child_next = lv_obj_get_child(obj, child);
lv_obj_del(child);
child = lv_obj_get_child(obj, child);
child = child_next;
}
}