diff --git a/docs/changes.md b/docs/changes.md index 0b2479c15..cd117d2a5 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -4,6 +4,7 @@ * 完善 graphic\_buffer\_default * 增加 tk\_mem\_is\_valid\_addr * 完善 edit 注释(感谢俊杰提供补丁)。 + * gif 隐藏后不再刷新。 * 完善 ui loader(感谢 dog2nd_Zhao 提供补丁)。 * 2020/06/30 diff --git a/src/ext_widgets/gif_image/gif_image.c b/src/ext_widgets/gif_image/gif_image.c index 287957e91..0b133b25d 100644 --- a/src/ext_widgets/gif_image/gif_image.c +++ b/src/ext_widgets/gif_image/gif_image.c @@ -31,7 +31,9 @@ static ret_t gif_image_on_timer(const timer_info_t* info) { return_value_if_fail(image != NULL, RET_BAD_PARAMS); image->index = 0; - widget_invalidate_force(WIDGET(image), NULL); + if (WIDGET(image)->visible) { + widget_invalidate_force(WIDGET(image), NULL); + } return RET_REPEAT; } @@ -41,7 +43,9 @@ static ret_t gif_image_on_timer(const timer_info_t* info) { return_value_if_fail(image != NULL, RET_BAD_PARAMS); image->index++; - widget_invalidate_force(WIDGET(image), NULL); + if (WIDGET(image)->visible) { + widget_invalidate_force(WIDGET(image), NULL); + } return RET_REPEAT; } #endif /*AWTK_WEB*/