[mapguide-commits] r1179 - trunk/MgDev/Common/Stylization

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Thu Mar 8 13:09:46 EST 2007


Author: traianstanev
Date: 2007-03-08 13:09:45 -0500 (Thu, 08 Mar 2007)
New Revision: 1179

Modified:
   trunk/MgDev/Common/Stylization/SE_Matrix.h
   trunk/MgDev/Common/Stylization/SE_Renderer.cpp
Log:
SE_Matrix was rotating things the wrong way.

Modified: trunk/MgDev/Common/Stylization/SE_Matrix.h
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Matrix.h	2007-03-08 12:27:21 UTC (rev 1178)
+++ trunk/MgDev/Common/Stylization/SE_Matrix.h	2007-03-08 18:09:45 UTC (rev 1179)
@@ -32,9 +32,9 @@
                         double y0, double y1, double y2);
     
     SE_INLINE void setIdentity();
+    /* Scale, then translate */
+    SE_INLINE void setTransform(double scaleX, double scaleY, double transX, double transY);
     /* Scale, then rotate, then translate */
-    SE_INLINE void setTransform(double scaleX, double scaleY, double transX, double transY);
-    /* Scale, then translate */
     SE_INLINE void setTransform(double scaleX, double scaleY, double transX, double transY, double rot);
     SE_INLINE void scaleX(double x);
     SE_INLINE void scaleY(double y);
@@ -99,10 +99,10 @@
     double cosine = cos(rot);
 
     x0 = scaleX*cosine;
-    x1 = scaleY*sine;
+    x1 = -scaleY*sine;
     x2 = transX;
 
-    y0 = -scaleX*sine;
+    y0 = scaleX*sine;
     y1 = scaleY*cosine;
     y2 = transY;
 }
@@ -154,14 +154,14 @@
     double cosine = cos(angle);
     double sine = sin(angle);
 
-    a00 = x0*cosine + y0*sine;
-    a10 = y0*cosine - x0*sine;
+    a00 = x0*cosine - y0*sine;
+    a10 = y0*cosine + x0*sine;
 
-    a01 = x1*cosine + y1*sine;
-    a11 = y1*cosine - x1*sine;
+    a01 = x1*cosine - y1*sine;
+    a11 = y1*cosine + x1*sine;
 
-    a02 = x2*cosine + y2*sine;
-    a12 = y2*cosine - x2*sine;
+    a02 = x2*cosine - y2*sine;
+    a12 = y2*cosine + x2*sine;
 
     x0 = a00; x1 = a01; x2 = a02;
     y0 = a10; y1 = a11; y2 = a12;

Modified: trunk/MgDev/Common/Stylization/SE_Renderer.cpp
===================================================================
--- trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2007-03-08 12:27:21 UTC (rev 1178)
+++ trunk/MgDev/Common/Stylization/SE_Renderer.cpp	2007-03-08 18:09:45 UTC (rev 1179)
@@ -60,7 +60,6 @@
 
 void SE_Renderer::ProcessLine(SE_LineBuffer* geometry, SE_RenderLineStyle* style)
 {
-    SE_Matrix xform;
     SE_Matrix symxf;
     SE_Geometry geom;
     geom.points = geometry->xf_points();
@@ -69,8 +68,6 @@
     geom.n_cntrs = geometry->xf_cntr_cnt();
     geom.geom_type = geometry->xf_geom_type();
 
-    double yUp = GetFontEngine()->_Yup() ? 1.0 : -1.0;
-    
     int ptindex = 0;
 
     //convert increment to pixels
@@ -91,7 +88,6 @@
 
         while (cur_seg < ptcount - 1)
         {
-            xform.setIdentity();
             symxf.setIdentity();
 
             //current line segment
@@ -116,12 +112,10 @@
                 dx_incr = cos(slope);
                 dy_incr = sin(slope);
 
-                double symrot = wcscmp(L"FromAngle", style->orientation) == 0 ? style->angle : slope*yUp;
-                xform.rotate(slope*yUp); // negative for y-inversion
+                double symrot = wcscmp(L"FromAngle", style->orientation) == 0 ? style->angle : slope;
                 symxf.rotate(symrot);
                 double tx = seg[0] + dx_incr * drawpos;
                 double ty = seg[1] + dy_incr * drawpos;
-                xform.translate(tx, ty);
                 symxf.translate(tx, ty);
                 dx_incr *= increment;
                 dy_incr *= increment;
@@ -140,7 +134,6 @@
                             AddExclusionRegion(style, symxf, symrot);
                     }
 
-                    xform.translate(dx_incr, dy_incr);
                     symxf.translate(dx_incr, dy_incr);
                     drawpos += increment; 
                 }



More information about the mapguide-commits mailing list