From 897966b2c90f3bfb8cd2b07501d4307c3177ef49 Mon Sep 17 00:00:00 2001 From: Jasper van de Gronde Date: Tue, 20 Apr 2010 14:13:56 +0200 Subject: [PATCH] Small fix for nr-compose-transform (I compared against 255 where I should have compared against 255*255). --- src/libnr/nr-compose-transform.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.30.2