[mapserver-commits] r11825 - in trunk/mapserver: . mapscript/php
svn at osgeo.org
svn at osgeo.org
Wed Jun 15 16:35:08 EDT 2011
Author: aboudreault
Date: 2011-06-15 13:35:08 -0700 (Wed, 15 Jun 2011)
New Revision: 11825
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapscript/php/style.c
Log:
Fixed PHP MapScript opacity property of StyleObj no longer works (#3920)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2011-06-15 19:56:51 UTC (rev 11824)
+++ trunk/mapserver/HISTORY.TXT 2011-06-15 20:35:08 UTC (rev 11825)
@@ -15,6 +15,8 @@
Current Version (SVN trunk, 6.1-dev, future 6.2):
-------------------------------------------------
+- Fixed PHP MapScript opacity property of StyleObj no longer works (#3920)
+
- Fixed Using STYLEITEM AUTO, loadExpression fails when the label text
contains a space or begins with a double quote (#3481)
Modified: trunk/mapserver/mapscript/php/style.c
===================================================================
--- trunk/mapserver/mapscript/php/style.c 2011-06-15 19:56:51 UTC (rev 11824)
+++ trunk/mapserver/mapscript/php/style.c 2011-06-15 20:35:08 UTC (rev 11825)
@@ -187,7 +187,24 @@
else IF_SET_DOUBLE("minvalue", php_style->style->minvalue, value)
else IF_SET_DOUBLE("maxvalue", php_style->style->maxvalue, value)
else IF_SET_STRING("rangeitem", php_style->style->rangeitem, value)
- else IF_SET_LONG("opacity", php_style->style->opacity, value)
+ else if (STRING_EQUAL("opacity", property))
+ {
+ int alpha;
+ convert_to_long(value);
+ php_style->style->opacity = Z_LVAL_P(value);
+
+ /* apply opacity as the alpha channel color(s) */
+ if(php_style->style->opacity < 100)
+ alpha = MS_NINT(php_style->style->opacity*2.55);
+ else
+ alpha = 255;
+
+ php_style->style->color.alpha = alpha;
+ php_style->style->outlinecolor.alpha = alpha;
+ php_style->style->backgroundcolor.alpha = alpha;
+ php_style->style->mincolor.alpha = alpha;
+ php_style->style->maxcolor.alpha = alpha;
+ }
else if (STRING_EQUAL("symbolname", property))
{
convert_to_string(value);
More information about the mapserver-commits
mailing list