# HG changeset patch # User Chong Yidong # Date 1233940750 0 # Node ID a4a5037b3040bee3cb74dc1d87dfa36a87240b1e # Parent a308d330b349259152f98e3029ce3159aa26f5d2 (svg_load_image): Fix last change. diff -r a308d330b349 -r a4a5037b3040 src/image.c --- a/src/image.c Fri Feb 06 17:18:16 2009 +0000 +++ b/src/image.c Fri Feb 06 17:19:10 2009 +0000 @@ -8079,17 +8079,8 @@ /* Handle alpha channel by combining the image with a background color. */ specified_bg = image_spec_value (img->spec, QCbackground, NULL); - if (STRINGP (specified_bg) - && x_defined_color (f, SDATA (specified_bg), &background, 0)) - { - /* SVG pixmaps specify transparency in the last byte, so right - shift 8 bits to get rid of it, since emacs doesn't support - transparency. */ - background.red >>= 8; - background.green >>= 8; - background.blue >>= 8; - } - else + if (!STRINGP (specified_bg) + || !x_defined_color (f, SDATA (specified_bg), &background, 0)) { #ifndef HAVE_NS background.pixel = FRAME_BACKGROUND_PIXEL (f); @@ -8099,6 +8090,13 @@ #endif } + /* SVG pixmaps specify transparency in the last byte, so right + shift 8 bits to get rid of it, since emacs doesn't support + transparency. */ + background.red >>= 8; + background.green >>= 8; + background.blue >>= 8; + /* This loop handles opacity values, since Emacs assumes non-transparent images. Each pixel must be "flattened" by calculating the resulting color, given the transparency of the