diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-05-09 21:46:32 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-05-09 21:46:32 +1000 |
commit | 21aac3d8532c9aa1decab30c00d9f5a37067aa13 (patch) | |
tree | c874ac8494028f09461e4329f0bcfae8c0e5adb8 /src/gwin/gimage.c | |
parent | f7fa0dd78f3b807578d99cc0eefe40996b1f9037 (diff) | |
parent | 1478fdf41e3731cafacd22ff6f530fb724c02df3 (diff) | |
download | uGFX-21aac3d8532c9aa1decab30c00d9f5a37067aa13.tar.gz uGFX-21aac3d8532c9aa1decab30c00d9f5a37067aa13.tar.bz2 uGFX-21aac3d8532c9aa1decab30c00d9f5a37067aa13.zip |
Merge branch 'master' into gwin
Diffstat (limited to 'src/gwin/gimage.c')
-rw-r--r-- | src/gwin/gimage.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/gwin/gimage.c b/src/gwin/gimage.c index fdc6df84..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 @@ -127,7 +137,7 @@ GHandle gwinGImageCreate(GDisplay *g, GImageObject *gobj, GWindowInit *pInit) { return 0; // Ensure the gdispImageIsOpen() gives valid results - gobj->image.type = 0; + gdispImageInit(&gobj->image); // Initialise the timer #if GWIN_NEED_IMAGE_ANIMATION |