From 40e60828463a7762c3da9995812803374bca0cf1 Mon Sep 17 00:00:00 2001 From: James Shaw Date: Sat, 19 Jul 2008 16:59:29 +0000 Subject: Fix bug when the first pixel has <100% transparency, was calling fix_alpha() unnecessarily svn path=/import/jshaw/libsprite/; revision=10028 --- trunk/librosprite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trunk/librosprite.c b/trunk/librosprite.c index 00a2774..e21b8cb 100644 --- a/trunk/librosprite.c +++ b/trunk/librosprite.c @@ -574,7 +574,7 @@ static rosprite_error rosprite_load_high_color(uint8_t* image_in, uint8_t* mask, bool old_has_alpha = has_alpha_pixel_data; pixel = rosprite_upscale_color(pixel, &(sprite->mode), &has_alpha_pixel_data); - if (old_has_alpha != has_alpha_pixel_data) { + if (old_has_alpha != has_alpha_pixel_data && (y > 0 || x_pixels > 0)) { rosprite_fix_alpha(sprite->image, (y * sprite->width) + x_pixels - 1); } if (sprite->has_mask) { -- cgit v1.2.3