Skip to content

Commit

Permalink
Consider data defined size on symbol level for ellipse renderer (tick…
Browse files Browse the repository at this point in the history
…et 4295)
  • Loading branch information
marco committed Sep 24, 2011
1 parent 21b3f16 commit a0f8294
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/core/symbology-ng/qgsellipsesymbollayerv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ void QgsEllipseSymbolLayerV2::renderPoint( const QPointF& point, QgsSymbolV2Rend
return;
}

//priority for rotation: 1. data defined, 2. symbol layer rotation (mAngle)
//priority for rotation: 1. data defined symbol level, 2. symbol layer rotation (mAngle)
double rotation = 0.0;
if ( f && mRotationField.first != -1 )
{
Expand Down Expand Up @@ -211,21 +211,30 @@ void QgsEllipseSymbolLayerV2::preparePath( const QString& symbolName, QgsSymbolV
mPainterPath = QPainterPath();

double width = 0;
if ( f && mWidthField.first != -1 )

if ( f && mWidthField.first != -1 ) //1. priority: data defined setting on symbol layer level
{
width = context.outputLineWidth( f->attributeMap()[mWidthField.first].toDouble() );
}
else
else if( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale ) //2. priority: is data defined size on symbol level
{
width = context.outputLineWidth( mSize );
}
else //3. priority: global width setting
{
width = context.outputLineWidth( mSymbolWidth );
}

double height = 0;
if ( f && mHeightField.first != -1 )
if ( f && mHeightField.first != -1 ) //1. priority: data defined setting on symbol layer level
{
height = context.outputLineWidth( f->attributeMap()[mHeightField.first].toDouble() );
}
else
else if( context.renderHints() & QgsSymbolV2::DataDefinedSizeScale ) //2. priority: is data defined size on symbol level
{
height = context.outputLineWidth( mSize );
}
else //3. priority: global height setting
{
height = context.outputLineWidth( mSymbolHeight );
}
Expand Down

0 comments on commit a0f8294

Please sign in to comment.