Skip to content

Commit 0ba3f5b

Browse files
committed
Fix incorrect size of markers with data defined name
1 parent dd1bb9f commit 0ba3f5b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/symbology-ng/qgsmarkersymbollayerv2.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,13 +539,15 @@ void QgsSimpleMarkerSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV
539539
off = _rotatedOffset( off, angle );
540540

541541
//data defined shape?
542+
bool createdNewPath = false;
542543
if ( mNameExpression )
543544
{
544545
QString name = mNameExpression->evaluate( const_cast<QgsFeature*>( context.feature() ) ).toString();
545546
if ( !prepareShape( name ) ) // drawing as a polygon
546547
{
547548
preparePath( name ); // drawing as a painter path
548549
}
550+
createdNewPath = true;
549551
}
550552

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

567569
// resize if necessary
568-
if ( hasDataDefinedSize )
570+
if ( hasDataDefinedSize || createdNewPath )
569571
{
570-
571572
double s = scaledSize * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mSizeUnit, mSizeMapUnitScale );
572-
573573
double half = s / 2.0;
574574
transform.scale( half, half );
575575
}
576576

577577
bool hasDataDefinedRotation = context.renderHints() & QgsSymbolV2::DataDefinedRotation || mAngleExpression;
578-
if ( angle != 0 && hasDataDefinedRotation )
578+
if ( angle != 0 && ( hasDataDefinedRotation || createdNewPath ) )
579579
transform.rotate( angle );
580580

581581
QgsExpression* colorExpression = expression( "color" );

0 commit comments

Comments
 (0)