changeset 101638:b6df48c94ca5

* image.c (svg_load_image): Don't right-shift background RGB when obtained from FRAME_BACKGROUND_PIXEL. Under HAVE_NS use ns_query_color.
author Adrian Robert <Adrian.B.Robert@gmail.com>
date Thu, 29 Jan 2009 10:36:49 +0000
parents c32306216562
children 789d88174e93
files src/image.c
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/image.c	Thu Jan 29 10:36:22 2009 +0000
+++ b/src/image.c	Thu Jan 29 10:36:49 2009 +0000
@@ -8082,15 +8082,6 @@
   if (STRINGP (specified_bg)
       && x_defined_color (f, SDATA (specified_bg), &background, 0))
     {
-      background.red   >>= 8;
-      background.green >>= 8;
-      background.blue  >>= 8;
-    }
-  else
-    {
-      background.pixel = FRAME_BACKGROUND_PIXEL (f);
-      x_query_color (f, &background);
-
       /* SVG pixmaps specify transparency in the last byte, so right
 	 shift 8 bits to get rid of it, since emacs doesn't support
 	 transparency.  */
@@ -8098,6 +8089,15 @@
       background.green >>= 8;
       background.blue  >>= 8;
     }
+  else
+    {
+#ifndef HAVE_NS
+      background.pixel = FRAME_BACKGROUND_PIXEL (f);
+      x_query_color (f, &background);
+#else
+      ns_query_color(FRAME_BACKGROUND_COLOR (f), &background, 1);
+#endif
+    }
 
   /* This loop handles opacity values, since Emacs assumes
      non-transparent images.  Each pixel must be "flattened" by