@@ -156,13 +156,15 @@ void QgsPointDisplacementRenderer::drawGroup( const DisplacementGroup& group, Qg
156
156
157
157
// get list of labels and symbols
158
158
QStringList labelAttributeList;
159
- QList<QgsMarkerSymbolV2*> symbolList;
159
+ QList< QgsMarkerSymbolV2* > symbolList;
160
+ QgsFeatureList featureList;
160
161
161
162
QgsMultiPointV2* groupMultiPoint = new QgsMultiPointV2 ();
162
163
for ( DisplacementGroup::const_iterator attIt = group.constBegin (); attIt != group.constEnd (); ++attIt )
163
164
{
164
165
labelAttributeList << ( mDrawLabels ? getLabel ( attIt.value ().first ) : QString () );
165
166
symbolList << dynamic_cast <QgsMarkerSymbolV2*>( attIt.value ().second );
167
+ featureList << attIt.value ().first ;
166
168
groupMultiPoint->addGeometry ( attIt.value ().first .constGeometry ()->geometry ()->clone () );
167
169
}
168
170
@@ -210,7 +212,7 @@ void QgsPointDisplacementRenderer::drawGroup( const DisplacementGroup& group, Qg
210
212
}
211
213
212
214
// draw symbols on the circle
213
- drawSymbols ( feature , context, symbolList, symbolPositions, selected );
215
+ drawSymbols ( featureList , context, symbolList, symbolPositions, selected );
214
216
// and also the labels
215
217
drawLabels ( pt, symbolContext, labelPositions, labelAttributeList );
216
218
}
@@ -619,15 +621,21 @@ void QgsPointDisplacementRenderer::drawCircle( double radiusPainterUnits, QgsSym
619
621
p->drawArc ( QRectF ( centerPoint.x () - radiusPainterUnits, centerPoint.y () - radiusPainterUnits, 2 * radiusPainterUnits, 2 * radiusPainterUnits ), 0 , 5760 );
620
622
}
621
623
622
- void QgsPointDisplacementRenderer::drawSymbols ( const QgsFeature& f, QgsRenderContext& context, const QList<QgsMarkerSymbolV2*>& symbolList, const QList<QPointF>& symbolPositions, bool selected )
624
+ void QgsPointDisplacementRenderer::drawSymbols ( const QgsFeatureList& features, QgsRenderContext& context,
625
+ const QList< QgsMarkerSymbolV2* >& symbolList, const QList<QPointF>& symbolPositions, bool selected )
623
626
{
624
627
QList<QPointF>::const_iterator symbolPosIt = symbolPositions.constBegin ();
625
628
QList<QgsMarkerSymbolV2*>::const_iterator symbolIt = symbolList.constBegin ();
626
- for ( ; symbolPosIt != symbolPositions.constEnd () && symbolIt != symbolList.constEnd (); ++symbolPosIt, ++symbolIt )
629
+ QgsFeatureList::const_iterator featIt = features.constBegin ();
630
+ for ( ; symbolPosIt != symbolPositions.constEnd () && symbolIt != symbolList.constEnd () && featIt != features.constEnd ();
631
+ ++symbolPosIt, ++symbolIt, ++featIt )
627
632
{
628
633
if ( *symbolIt )
629
634
{
630
- ( *symbolIt )->renderPoint ( *symbolPosIt, &f, context, -1 , selected );
635
+ context.expressionContext ().setFeature ( *featIt );
636
+ ( *symbolIt )->startRender ( context );
637
+ ( *symbolIt )->renderPoint ( *symbolPosIt, &( *featIt ), context, -1 , selected );
638
+ ( *symbolIt )->stopRender ( context );
631
639
}
632
640
}
633
641
}
0 commit comments