]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[script] Remember the width and height of old sprite image for next refresh
authorCharlie Brej <cbrej@cs.man.ac.uk>
Mon, 29 Jun 2009 15:46:06 +0000 (16:46 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Mon, 29 Jun 2009 15:46:06 +0000 (16:46 +0100)
When we change the sprite image, the redraw now remembers to refresh the old
area despite any change in the image size.

src/plugins/splash/script/script-lib-sprite.c
src/plugins/splash/script/script-lib-sprite.h

index 5254470b461bf41152940b010ef73330faee91c1..76b22825d291904806e5156ccfa43c980ecc2ece 100644 (file)
@@ -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;
         }
index e71786fcdad7c6972d2e3b9e2308d1467f48dc19..4892a1386d7dcd3ec00a836c177cf2ed6a81111e 100644 (file)
@@ -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;