Skip to content

Commit

Permalink
Fix broken area scaling for simple marker symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 21, 2015
1 parent d62794d commit a32ac3d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
Expand Up @@ -469,19 +469,25 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
return;
}

double scaledSize = mSize;

bool hasDataDefinedSize = context.renderHints() & QgsSymbolV2::DataDefinedSizeScale || hasDataDefinedProperty( EXPR_SIZE );

double scaledSize = mSize;
bool ok;
if ( hasDataDefinedSize )
bool ok = true;
if ( hasDataDefinedProperty( EXPR_SIZE ) )
{
if ( hasDataDefinedProperty( EXPR_SIZE ) )
scaledSize = evaluateDataDefinedProperty( EXPR_SIZE, context.feature(), mSize, &ok ).toDouble();
}

if ( hasDataDefinedSize && ok )
{
switch ( mScaleMethod )
{
scaledSize = evaluateDataDefinedProperty( EXPR_SIZE, context.feature(), mSize, &ok ).toDouble();
if ( ok && mScaleMethod == QgsSymbolV2::ScaleArea )
{
case QgsSymbolV2::ScaleArea:
scaledSize = sqrt( scaledSize );
}
break;
case QgsSymbolV2::ScaleDiameter:
break;
}
}

Expand Down

0 comments on commit a32ac3d

Please sign in to comment.