[mapserver-commits] r11184 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Wed Mar 16 16:43:14 EDT 2011


Author: sdlime
Date: 2011-03-16 13:43:14 -0700 (Wed, 16 Mar 2011)
New Revision: 11184

Modified:
   trunk/mapserver/maputil.c
Log:
Updated style binding to apply opacity to the various style colors alpha channel.

Modified: trunk/mapserver/maputil.c
===================================================================
--- trunk/mapserver/maputil.c	2011-03-16 20:41:03 UTC (rev 11183)
+++ trunk/mapserver/maputil.c	2011-03-16 20:43:14 UTC (rev 11184)
@@ -140,6 +140,18 @@
     if(style->bindings[MS_STYLE_BINDING_OPACITY].index != -1) {
       style->opacity = 100;
       bindIntegerAttribute(&style->opacity, shape->values[style->bindings[MS_STYLE_BINDING_OPACITY].index]);
+
+      if(style->opacity < 100) {
+        int alpha;
+	alpha = MS_NINT(style->opacity*2.55);
+
+	style->color.alpha = alpha;
+	style->outlinecolor.alpha = alpha;
+	style->backgroundcolor.alpha = alpha;
+
+	style->mincolor.alpha = alpha;
+	style->maxcolor.alpha = alpha;
+      }
     }
   }
 }



More information about the mapserver-commits mailing list