fix bug in image_annimation

This commit is contained in:
xianjimli 2018-11-02 17:10:46 +08:00
parent 6c7563351f
commit d23392603e

View File

@ -116,7 +116,9 @@ static const widget_vtable_t s_image_animation_vtable = {
static ret_t image_animation_delay_play(const timer_info_t* info) { static ret_t image_animation_delay_play(const timer_info_t* info) {
widget_t* widget = WIDGET(info->ctx); widget_t* widget = WIDGET(info->ctx);
image_animation_t* image_animation = IMAGE_ANIMATION(widget);
image_animation->timer_id = TK_INVALID_ID;
image_animation_play(widget); image_animation_play(widget);
return RET_REMOVE; return RET_REMOVE;
@ -128,7 +130,7 @@ static ret_t image_animation_on_open(void* ctx, event_t* e) {
if (image_animation->auto_play) { if (image_animation->auto_play) {
if (image_animation->delay > 0) { if (image_animation->delay > 0) {
timer_add(image_animation_delay_play, widget, image_animation->delay); image_animation->timer_id = timer_add(image_animation_delay_play, widget, image_animation->delay);
} else { } else {
image_animation_play(widget); image_animation_play(widget);
} }