Skip to content
Permalink
Browse files

Scale/diameter scale also for svg marker

  • Loading branch information
mhugent committed May 23, 2013
1 parent 818d97e commit d7663a0789b3eceb55c7e3fd535414ac73f8e9b6
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
@@ -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 )
{

0 comments on commit d7663a0

Please sign in to comment.
You can’t perform that action at this time.