diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-05-09 21:33:33 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-05-09 21:33:33 +1000 |
commit | 0f109512fde45684fe36e84101a84f7280b28394 (patch) | |
tree | 5df886fa362aaa6106ea73d3151a3bf67da32e55 /src | |
parent | 6d2c8f0f509f2e66d4fea444ce220550a0df6da5 (diff) | |
download | uGFX-0f109512fde45684fe36e84101a84f7280b28394.tar.gz uGFX-0f109512fde45684fe36e84101a84f7280b28394.tar.bz2 uGFX-0f109512fde45684fe36e84101a84f7280b28394.zip |
gwinImage animated gif bug fix
Diffstat (limited to 'src')
-rw-r--r-- | src/gwin/gimage.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/src/gwin/gimage.c b/src/gwin/gimage.c index 07d27dd0..9d6363ba 100644 --- a/src/gwin/gimage.c +++ b/src/gwin/gimage.c @@ -26,10 +26,20 @@ static void _destroy(GWindowObject *gh) { #if GWIN_NEED_IMAGE_ANIMATION static void _redraw(GHandle gh); - static void _timer(void *gh) { + static void _timer(void *param) { + #define gh ((GHandle)param) + // We need to re-test the visibility in case it has been made invisible since the last frame. - if ((((GHandle)gh)->flags & GWIN_FLG_VISIBLE)) - _redraw((GHandle)gh); + if ((gh->flags & GWIN_FLG_VISIBLE)) { + // Setting the clip here shouldn't be necessary if the redraw doesn't overdraw + // but we put it in for safety anyway + #if GDISP_NEED_CLIP + gdispGSetClip(gh->display, gh->x, gh->y, gh->width, gh->height); + #endif + _redraw(gh); + } + + #undef gh } #endif |