[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mapguide-commits
Subject:    [mapguide-commits] r3281 - trunk/MgDev/Common/Stylization
From:       svn_mapguide () osgeo ! org
Date:       2008-08-20 20:42:28
Message-ID: 20080820204229.97C19E0068B () lists ! osgeo ! org
[Download RAW message or body]

Author: waltweltonlair
Date: 2008-08-20 16:42:26 -0400 (Wed, 20 Aug 2008)
New Revision: 3281

Modified:
   trunk/MgDev/Common/Stylization/PointAdapter.cpp
   trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp
   trunk/MgDev/Common/Stylization/StylizationDefs.h
Log:
The old stylization was offsetting labels 0.5 mm from the point feature's symbol, \
while the new stylization was offsetting them 1 mm.  In both cases the offset was \
also hard-coded.

I created a const variable in StylizationDefs.h which stores this offset in a single \
place. It's set to 1 mm.


Modified: trunk/MgDev/Common/Stylization/PointAdapter.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/PointAdapter.cpp	2008-08-19 15:26:05 UTC (rev \
                3280)
+++ trunk/MgDev/Common/Stylization/PointAdapter.cpp	2008-08-20 20:42:26 UTC (rev \
3281) @@ -192,8 +192,8 @@
 
                     double op_pts[16];
 
-                    // offset labels by 1/2 mm offset from symbol's edge
-                    double offset = 0.0005;
+                    // offset the label from the symbol's edge
+                    double offset = 0.001 * POINT_LABEL_OFFSET_MM;  // in meters
                     if (def.rotation() != 0.0)
                     {
                         // if the text label has rotation put the text at least half \
the font height

Modified: trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp	2008-08-19 15:26:05 \
                UTC (rev 3280)
+++ trunk/MgDev/Common/Stylization/SE_PositioningAlgorithms.cpp	2008-08-20 20:42:26 \
UTC (rev 3281) @@ -232,9 +232,8 @@
     double symbol_width  = symbol_bounds.width();   // symbol width in screen units
     double symbol_height = symbol_bounds.height();  // symbol height in screen units
 
-    // we will offset the label 1 mm from the symbol
-    double offsetmm = 1.0;              // offset in mm
-    double offset = offsetmm * mm2su;   // offset in screen units
+    // offset the label from the symbol's edge
+    double offset = POINT_LABEL_OFFSET_MM * mm2su;  // offset in screen units
 
     // make sure we have at least one pixel's worth of offset
     double screenUnitsPerPixel = MILLIMETERS_PER_INCH * \
se_renderer->GetScreenUnitsPerMillimeterDevice() / se_renderer->GetDpi();

Modified: trunk/MgDev/Common/Stylization/StylizationDefs.h
===================================================================
--- trunk/MgDev/Common/Stylization/StylizationDefs.h	2008-08-19 15:26:05 UTC (rev \
                3280)
+++ trunk/MgDev/Common/Stylization/StylizationDefs.h	2008-08-20 20:42:26 UTC (rev \
3281) @@ -36,6 +36,9 @@
 const double MILLIMETERS_PER_INCH = 25.4;
 const double STANDARD_DISPLAY_DPI = 96.0;
 
+// the distance by which point labels are offset from the symbol's edge
+const double POINT_LABEL_OFFSET_MM = 1.0;
+
 #define SE_INLINE inline
 
 #ifdef _WIN32

_______________________________________________
mapguide-commits mailing list
mapguide-commits@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-commits


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic