From: Charlie Brej Date: Tue, 18 Aug 2009 15:39:50 +0000 (+0100) Subject: [image] Scale images not using data beyond the edge of the last pixel X-Git-Tag: 0.7.1~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a4836e83fe3baa74ab3a6321978d36ef95a394f8;p=thirdparty%2Fplymouth.git [image] Scale images not using data beyond the edge of the last pixel 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. --- diff --git a/src/libplybootsplash/ply-image.c b/src/libplybootsplash/ply-image.c index 32e033c4..812313c5 100644 --- a/src/libplybootsplash/ply-image.c +++ b/src/libplybootsplash/ply-image.c @@ -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++) {