[mapguide-commits] r4311 - sandbox/adsk/2.1/Server/src/Services/Mapping

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Oct 20 14:04:41 EDT 2009


Author: waltweltonlair
Date: 2009-10-20 14:04:40 -0400 (Tue, 20 Oct 2009)
New Revision: 4311

Modified:
   sandbox/adsk/2.1/Server/src/Services/Mapping/LegendPlotUtil.cpp
Log:
Fix #1120: Legend icons in generated DWF are tiny

When plotting to DWF, the legend icons were not the correct size (they were much too small).  I introduced this bug with submission r3959 (for the sandbox stream).  Fixed the code by having it account for the world-to-screen transform when computing the image width and height. 


Modified: sandbox/adsk/2.1/Server/src/Services/Mapping/LegendPlotUtil.cpp
===================================================================
--- sandbox/adsk/2.1/Server/src/Services/Mapping/LegendPlotUtil.cpp	2009-10-20 05:46:05 UTC (rev 4310)
+++ sandbox/adsk/2.1/Server/src/Services/Mapping/LegendPlotUtil.cpp	2009-10-20 18:04:40 UTC (rev 4311)
@@ -91,12 +91,15 @@
     if (!drSE)
         return;
 
-    double cx = 0.5 * (extents.minx + extents.maxx);
-    double cy = 0.5 * (extents.miny + extents.maxy);
-    drSE->WorldToScreenPoint(cx, cy, cx, cy);
+    double minx, miny, maxx, maxy;
+    drSE->WorldToScreenPoint(extents.minx, extents.miny, minx, miny);
+    drSE->WorldToScreenPoint(extents.maxx, extents.maxy, maxx, maxy);
 
-    double imgDevW = extents.width();
-    double imgDevH = extents.height();
+    double cx = 0.5 * (minx + maxx);
+    double cy = 0.5 * (miny + maxy);
+    double imgDevW = fabs(maxx - minx);
+    double imgDevH = fabs(maxy - miny);
+
     drSE->DrawScreenRaster(data, length, RS_ImageFormat_PNG, width, height, cx, cy, imgDevW, imgDevH, 0.0);
 }
 



More information about the mapguide-commits mailing list