From 8d3c4e79fb7af9816300834842fb4a30e661211d Mon Sep 17 00:00:00 2001 From: Chong Yidong Date: Fri, 6 Feb 2009 17:19:10 +0000 Subject: [PATCH] (svg_load_image): Fix last change. --- src/image.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/image.c b/src/image.c index a02f86a9c90..3323a68d33f 100644 --- a/src/image.c +++ b/src/image.c @@ -8079,17 +8079,8 @@ svg_load_image (f, img, contents, size) /* 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 @@ svg_load_image (f, img, contents, size) #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 -- 2.39.5