Skip to content
Permalink
Browse files

Fix incorrect size of markers with data defined name

  • Loading branch information
nyalldawson committed Dec 11, 2014
1 parent dd1bb9f commit 0ba3f5bae060fda7ef7a91e0f474530d2ab26c5b
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/core/symbology-ng/qgsmarkersymbollayerv2.cpp
@@ -539,13 +539,15 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
off = _rotatedOffset( off, angle );

//data defined shape?
bool createdNewPath = false;
if ( mNameExpression )
{
QString name = mNameExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toString();
if ( !prepareShape( name ) ) // drawing as a polygon
{
preparePath( name ); // drawing as a painter path
}
createdNewPath = true;
}

if ( mUsingCache )
@@ -565,17 +567,15 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
transform.translate( point.x() + off.x(), point.y() + off.y() );

// resize if necessary
if ( hasDataDefinedSize )
if ( hasDataDefinedSize || createdNewPath )
{

double s = scaledSize * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit, mSizeMapUnitScale );

double half = s / 2.0;
transform.scale( half, half );
}

bool hasDataDefinedRotation = context.renderHints() & QgsSymbolV2::DataDefinedRotation || mAngleExpression;
if ( angle != 0 && hasDataDefinedRotation )
if ( angle != 0 && ( hasDataDefinedRotation || createdNewPath ) )
transform.rotate( angle );

QgsExpression* colorExpression = expression( "color" );

0 comments on commit 0ba3f5b

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