[QGIS Commit] r13947 - trunk/qgis/src/core/symbology-ng

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Jul 20 10:02:49 EDT 2010


Author: wonder
Date: 2010-07-20 14:02:49 +0000 (Tue, 20 Jul 2010)
New Revision: 13947

Modified:
   trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.cpp
Log:
Use size scale also for line symbols to modify line width.

Developed for Faunalia (http://www.faunalia.it) with funding from Regione Toscana - Sistema Informativo per la Gestione del Territorio e dell' Ambiente [RT-SIGTA].
For the project: "Sviluppo di prodotti software GIS open-source basati sui prodotti QuantumGIS e Postgis (CIG 037728516E)"


Modified: trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.cpp
===================================================================
--- trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.cpp	2010-07-20 13:59:09 UTC (rev 13946)
+++ trunk/qgis/src/core/symbology-ng/qgslinesymbollayerv2.cpp	2010-07-20 14:02:49 UTC (rev 13947)
@@ -102,6 +102,13 @@
     return;
   }
 
+  if ( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale )
+  {
+    double scaledWidth = context.outputLineWidth( mWidth );
+    mPen.setWidthF( scaledWidth );
+    mSelPen.setWidthF( scaledWidth );
+  }
+
   p->setPen( context.selected() ? mSelPen : mPen );
   if ( mOffset == 0 )
   {
@@ -250,8 +257,12 @@
   mMarker->setOutputUnit( context.outputUnit() );
 
   // if being rotated, it gets initialized with every line segment
+  int hints = 0;
   if ( mRotateMarker )
-    mMarker->setRenderHints( QgsSymbolV2::DataDefinedRotation );
+    hints |= QgsSymbolV2::DataDefinedRotation;
+  if ( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale )
+    hints |= QgsSymbolV2::DataDefinedSizeScale;
+  mMarker->setRenderHints( hints );
 
   mMarker->startRender( context.renderContext() );
 }



More information about the QGIS-commit mailing list