summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Shaw <jshaw@netsurf-browser.org>2008-07-19 16:59:29 (GMT)
committer James Shaw <jshaw@netsurf-browser.org>2008-07-19 16:59:29 (GMT)
commit40e60828463a7762c3da9995812803374bca0cf1 (patch)
tree66cca8f0146c0762304f61c525b9f28110b3f0ab
parent5badfb5fb1c21da98e1076cf021957e8a934ddf3 (diff)
downloadlibrosprite-40e60828463a7762c3da9995812803374bca0cf1.tar.gz
librosprite-40e60828463a7762c3da9995812803374bca0cf1.tar.bz2
Fix bug when the first pixel has <100% transparency, was calling fix_alpha() unnecessarily
svn path=/import/jshaw/libsprite/; revision=10028
-rw-r--r--trunk/librosprite.c2
1 files changed, 1 insertions, 1 deletions
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) {