From: Charlie Brej Date: Mon, 29 Jun 2009 15:46:06 +0000 (+0100) Subject: [script] Remember the width and height of old sprite image for next refresh X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=965ea3d9cb47fd02c7cd114957144064d41f424c;p=thirdparty%2Fplymouth.git [script] Remember the width and height of old sprite image for next refresh When we change the sprite image, the redraw now remembers to refresh the old area despite any change in the image size. --- diff --git a/src/plugins/splash/script/script-lib-sprite.c b/src/plugins/splash/script/script-lib-sprite.c index 5254470b..76b22825 100644 --- a/src/plugins/splash/script/script-lib-sprite.c +++ b/src/plugins/splash/script/script-lib-sprite.c @@ -259,10 +259,12 @@ void script_lib_sprite_refresh(script_lib_sprite_data_t* data) int width = ply_image_get_width (sprite->image); int height= ply_image_get_height (sprite->image); draw_area (data, sprite->x, sprite->y, width, height); - draw_area (data, sprite->old_x, sprite->old_y, width, height); + draw_area (data, sprite->old_x, sprite->old_y, sprite->old_width, sprite->old_height); sprite->old_x = sprite->x; sprite->old_y = sprite->y; sprite->old_z = sprite->z; + sprite->old_width = width; + sprite->old_height = height; sprite->old_opacity = sprite->opacity; sprite->refresh_me = false; } diff --git a/src/plugins/splash/script/script-lib-sprite.h b/src/plugins/splash/script/script-lib-sprite.h index e71786fc..4892a138 100644 --- a/src/plugins/splash/script/script-lib-sprite.h +++ b/src/plugins/splash/script/script-lib-sprite.h @@ -21,6 +21,8 @@ typedef struct int old_x; int old_y; int old_z; + int old_width; + int old_height; float old_opacity; bool refresh_me; bool remove_me;