From: Jasper van de Gronde Date: Tue, 20 Apr 2010 12:13:56 +0000 (+0200) Subject: Small fix for nr-compose-transform (I compared against 255 where I should have compar... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=897966b2c90f3bfb8cd2b07501d4307c3177ef49;p=inkscape.git Small fix for nr-compose-transform (I compared against 255 where I should have compared against 255*255). --- diff --git a/src/libnr/nr-compose-transform.cpp b/src/libnr/nr-compose-transform.cpp index bc05c7b51..e7c286569 100644 --- a/src/libnr/nr-compose-transform.cpp +++ b/src/libnr/nr-compose-transform.cpp @@ -135,7 +135,7 @@ nr_R8G8B8A8_N_R8G8B8A8_N_R8G8B8A8_N_TRANSFORM (unsigned char *px, int w, int h, r = (r + rounding_fix) >> dbits; g = (g + rounding_fix) >> dbits; b = (b + rounding_fix) >> dbits; - if (a == 255) { + if (a == 255*255) { /* Full coverage, demul src */ d[0] = NR_NORMALIZE_21(r); d[1] = NR_NORMALIZE_21(g); @@ -275,7 +275,7 @@ nr_R8G8B8A8_P_R8G8B8A8_P_R8G8B8A8_N_TRANSFORM_n (unsigned char *px, int w, int h r = (r + rounding_fix) >> dbits; g = (g + rounding_fix) >> dbits; b = (b + rounding_fix) >> dbits; - if ((a == 255) || (d[3] == 0)) { + if ((a == 255*255) || (d[3] == 0)) { /* Transparent BG, premul src */ d[0] = NR_NORMALIZE_21(r); d[1] = NR_NORMALIZE_21(g);