[QGIS Commit] r12791 - in trunk/qgis/src: core/symbology-ng gui/symbology-ng

svn_qgis at osgeo.org svn_qgis at osgeo.org
Mon Jan 18 12:41:59 EST 2010


Author: wonder
Date: 2010-01-18 12:41:58 -0500 (Mon, 18 Jan 2010)
New Revision: 12791

Modified:
   trunk/qgis/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
   trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp
Log:
Added vertical line to simple marker symbol layer.
Added rotation for ellipse, cross and line markers.


Modified: trunk/qgis/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp	2010-01-18 16:15:55 UTC (rev 12790)
+++ trunk/qgis/src/core/symbology-ng/qgsmarkersymbollayerv2.cpp	2010-01-18 17:41:58 UTC (rev 12791)
@@ -235,7 +235,11 @@
   {
     double scaledSize = context.outputPixelSize( mSize );
     double half = scaledSize / 2.0;
-    // TODO: rotate
+    if ( mAngle != 0 )
+    {
+      p->save();
+      p->rotate( mAngle );
+    }
 
     if ( mName == "circle" )
     {
@@ -251,6 +255,13 @@
       p->drawLine( QPointF( -half, -half ), QPointF( half,  half ) );
       p->drawLine( QPointF( -half,  half ), QPointF( half, -half ) );
     }
+    else if ( mName == "line" )
+    {
+      p->drawLine( QPointF( 0, -half ), QPointF( 0, half ) ); // vertical line
+    }
+
+    if ( mAngle != 0 )
+      p->restore();
   }
 
 }
@@ -327,7 +338,7 @@
   }
 
   p->save();
-  QPointF outputOffset = QPointF(context.outputLineWidth( mOffset.x() ), context.outputLineWidth( mOffset.y() ) );
+  QPointF outputOffset = QPointF( context.outputLineWidth( mOffset.x() ), context.outputLineWidth( mOffset.y() ) );
   p->translate( point + outputOffset );
 
   if ( mAngle != 0 )

Modified: trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp
===================================================================
--- trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp	2010-01-18 16:15:55 UTC (rev 12790)
+++ trunk/qgis/src/gui/symbology-ng/qgssymbollayerv2widget.cpp	2010-01-18 17:41:58 UTC (rev 12791)
@@ -161,7 +161,7 @@
   QSize size = lstNames->iconSize();
   QStringList names;
   names << "circle" << "rectangle" << "diamond" << "pentagon" << "cross" << "cross2" << "triangle"
-  << "equilateral_triangle" << "star" << "regular_star" << "arrow";
+  << "equilateral_triangle" << "star" << "regular_star" << "arrow" << "line";
   double markerSize = size.width() - 1; // keep some space around
   for ( int i = 0; i < names.count(); ++i )
   {



More information about the QGIS-commit mailing list