[mapguide-commits] r8065 - in trunk/MgDev/Common: Renderers Stylization

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Apr 23 06:16:38 PDT 2014


Author: jng
Date: 2014-04-23 06:16:38 -0700 (Wed, 23 Apr 2014)
New Revision: 8065

Modified:
   trunk/MgDev/Common/Renderers/AGGRenderer.cpp
   trunk/MgDev/Common/Renderers/GDRenderer.cpp
   trunk/MgDev/Common/Stylization/SE_Renderer.cpp
Log:
#852: Respect the alpha component of selection colors. However, for the sake of compatibility with un-modified AJAX/Fusion viewers, we still apply the old override logic if the alpha component is fully opaque (ie. FF)

Modified: trunk/MgDev/Common/Renderers/AGGRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Renderers/AGGRenderer.cpp	2014-04-23 08:26:29 UTC (rev 8064)
+++ trunk/MgDev/Common/Renderers/AGGRenderer.cpp	2014-04-23 13:16:38 UTC (rev 8065)
@@ -1421,7 +1421,10 @@
     if (mode)
     {
         RS_Color selLineColor = RS_Color((rgba & 0xFFFFFF00) | 200);
-        RS_Color selFillColor = RS_Color((rgba & 0xFFFFFF00) | 160);
+        RS_Color selFillColor(rgba & 0xFFFFFFFF);
+        //For backward compatibility, only do the override if we have a fully opaque alpha component, otherwise respect the value defined
+        if (selFillColor.alpha() == 255)
+            selFillColor = RS_Color((rgba & 0xFFFFFF00) | 160);
         RS_Color selBgColor(0, 0, 0, 0);
         RS_LineStroke selStroke = RS_LineStroke(selLineColor, 0.001, L"Solid", RS_Units_Device);
         m_selFill = RS_FillStyle(selStroke, selFillColor, selBgColor, L"Solid");

Modified: trunk/MgDev/Common/Renderers/GDRenderer.cpp
===================================================================
--- trunk/MgDev/Common/Renderers/GDRenderer.cpp	2014-04-23 08:26:29 UTC (rev 8064)
+++ trunk/MgDev/Common/Renderers/GDRenderer.cpp	2014-04-23 13:16:38 UTC (rev 8065)
@@ -1541,7 +1541,10 @@
     if (mode)
     {
         RS_Color selLineColor = RS_Color((rgba & 0xFFFFFF00) | 200);
-        RS_Color selFillColor = RS_Color((rgba & 0xFFFFFF00) | 160);
+        RS_Color selFillColor(rgba & 0xFFFFFFFF);
+        //For backward compatibility, only do the override if we have a fully opaque alpha component, otherwise respect the value defined
+        if (selFillColor.alpha() == 255)
+            selFillColor = RS_Color((rgba & 0xFFFFFF00) | 160);
         RS_Color selBgColor(0, 0, 0, 0);
         RS_LineStroke selStroke = RS_LineStroke(selLineColor, 0.001, L"Solid", RS_Units_Device);
         m_selFill = RS_FillStyle(selStroke, selFillColor, selBgColor, L"Solid");

Modified: trunk/MgDev/Common/Stylization/SE_Renderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2014-04-23 08:26:29 UTC (rev 8064)
+++ trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2014-04-23 13:16:38 UTC (rev 8065)
@@ -167,7 +167,12 @@
         m_selLineStroke.weight = 3.0;  // should be 1 to give 1mm, but the renderer is way off
         m_selLineStroke.color = RS_Color(rgb0 | 200).argb();
 
-        m_selFillColor  = RS_Color(rgb0 | 160).argb();
+        RS_Color selFillColor(rgba & 0xFFFFFFFF);
+        //For backward compatibility, only do the override if we have a fully opaque alpha component, otherwise respect the value defined
+        if (selFillColor.alpha() == 255)
+            selFillColor = RS_Color((rgba & 0xFFFFFF00) | 160);
+
+        m_selFillColor  = selFillColor.argb();
         m_textForeColor = RS_Color(rgb0 | 200);
         m_textBackColor = RS_Color(rgb0 | 255);
     }



More information about the mapguide-commits mailing list