]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[image] Scale images not using data beyond the edge of the last pixel
authorCharlie Brej <cbrej@cs.man.ac.uk>
Tue, 18 Aug 2009 15:39:50 +0000 (16:39 +0100)
committerCharlie Brej <cbrej@cs.man.ac.uk>
Tue, 18 Aug 2009 15:39:50 +0000 (16:39 +0100)
When using 1 pixel wide images and stretching them, the result is a fade
between the pixel data and the transparent pixels beyond the end of the image.

src/libplybootsplash/ply-image.c

index 32e033c4ab30c56ba744d8c33cdf905639bed192..812313c5a0b5fa105e2fb4f44b82b0c2ff524580 100644 (file)
@@ -342,8 +342,8 @@ ply_image_resize (ply_image_t *image,
   old_width = ply_image_get_width (image);
   old_height = ply_image_get_height (image);
 
-  scale_x = ((double) old_width) / width;
-  scale_y = ((double) old_height) / height;
+  scale_x = ((double) old_width - 1) / MAX (width - 1, 1);
+  scale_y = ((double) old_height - 1) / MAX (height - 1, 1);
 
   for (y = 0; y < height; y++)
     {