mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-27 11:57:48 +08:00
fix(bar): stop animation when set with LV_ANIM_OFF (#3538)
This commit is contained in:
@@ -584,6 +584,11 @@ static void lv_bar_set_value_with_anim(lv_obj_t * obj, int32_t new_value, int32_
|
|||||||
if(en == LV_ANIM_OFF) {
|
if(en == LV_ANIM_OFF) {
|
||||||
*value_ptr = new_value;
|
*value_ptr = new_value;
|
||||||
lv_obj_invalidate((lv_obj_t *)obj);
|
lv_obj_invalidate((lv_obj_t *)obj);
|
||||||
|
|
||||||
|
/*Stop the previous animation if it exists*/
|
||||||
|
lv_anim_del(anim_info, NULL);
|
||||||
|
/*Reset animation state*/
|
||||||
|
lv_bar_init_anim(obj, anim_info);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/*No animation in progress -> simply set the values*/
|
/*No animation in progress -> simply set the values*/
|
||||||
|
|||||||
Reference in New Issue
Block a user