Skip to content

Commit

Permalink
Use size scale also for line symbols to modify line width.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
wonder committed Jul 20, 2010
1 parent 1186807 commit 8445813
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/core/symbology-ng/qgslinesymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,13 @@ void QgsSimpleLineSymbolLayerV2::renderPolyline( const QPolygonF& points, QgsSym
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 )
{
Expand Down Expand Up @@ -250,8 +257,12 @@ void QgsMarkerLineSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context
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() );
}
Expand Down

0 comments on commit 8445813

Please sign in to comment.