mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
fix(indev): use lv_anim_delete
to delete scroll_throw_anim (#5324)
Signed-off-by: YanXiaowei <yanxiaowei@xiaomi.com> Co-authored-by: YanXiaowei <yanxiaowei@xiaomi.com>
This commit is contained in:
parent
57cda3b91c
commit
751bc99b98
@ -1564,9 +1564,8 @@ static void indev_scroll_throw_anim_cb(void * var, int32_t v)
|
||||
|
||||
if(indev->pointer.scroll_dir == LV_DIR_NONE || indev->pointer.scroll_obj == NULL) {
|
||||
if(indev->scroll_throw_anim) {
|
||||
/*hacky*/
|
||||
LV_LOG_INFO("stop animation");
|
||||
lv_anim_set_duration(indev->scroll_throw_anim, 0);
|
||||
lv_anim_delete(indev, indev_scroll_throw_anim_cb);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -379,11 +379,11 @@ static void anim_timer(lv_timer_t * param)
|
||||
a->current_value = new_value;
|
||||
/*Apply the calculated value*/
|
||||
if(a->exec_cb) a->exec_cb(a->var, new_value);
|
||||
if(a->custom_exec_cb) a->custom_exec_cb(a, new_value);
|
||||
if(!state.anim_list_changed && a->custom_exec_cb) a->custom_exec_cb(a, new_value);
|
||||
}
|
||||
|
||||
/*If the time is elapsed the animation is ready*/
|
||||
if(a->act_time >= a->duration) {
|
||||
if(!state.anim_list_changed && a->act_time >= a->duration) {
|
||||
anim_ready_handler(a);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user