Skip to content

Commit 8445813

Browse files
author
wonder
committed
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)" git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@13947 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 1186807 commit 8445813

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/core/symbology-ng/qgslinesymbollayerv2.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,13 @@ void QgsSimpleLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
102102
return;
103103
}
104104

105+
if ( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale )
106+
{
107+
double scaledWidth = context.outputLineWidth( mWidth );
108+
mPen.setWidthF( scaledWidth );
109+
mSelPen.setWidthF( scaledWidth );
110+
}
111+
105112
p->setPen( context.selected() ? mSelPen : mPen );
106113
if ( mOffset == 0 )
107114
{
@@ -250,8 +257,12 @@ void QgsMarkerLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context
250257
mMarker->setOutputUnit( context.outputUnit() );
251258

252259
// if being rotated, it gets initialized with every line segment
260+
int hints = 0;
253261
if ( mRotateMarker )
254-
mMarker->setRenderHints( QgsSymbolV2::DataDefinedRotation );
262+
hints |= QgsSymbolV2::DataDefinedRotation;
263+
if ( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale )
264+
hints |= QgsSymbolV2::DataDefinedSizeScale;
265+
mMarker->setRenderHints( hints );
255266

256267
mMarker->startRender( context.renderContext() );
257268
}

0 commit comments

Comments
 (0)