Skip to content

Commit

Permalink
Scale/diameter scale also for svg marker
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed May 23, 2013
1 parent 818d97e commit d7663a0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Expand Up @@ -843,11 +843,26 @@ void QgsSvgMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Re

double size = mSize;
QgsExpression* sizeExpression = expression( "size" );
bool hasDataDefinedSize = context.renderHints() & QgsSymbolV2::DataDefinedSizeScale || sizeExpression;

if ( sizeExpression )
{
size = sizeExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toDouble();
}
size *= QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit );

if ( hasDataDefinedSize )
{
switch ( mScaleMethod )
{
case QgsSymbolV2::ScaleArea:
size = sqrt( size );
break;
case QgsSymbolV2::ScaleDiameter:
break;
}
}

//don't render symbols with size below one or above 10,000 pixels
if (( int )size < 1 || 10000.0 < size )
{
Expand Down

0 comments on commit d7663a0

Please sign in to comment.