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