@@ -135,24 +135,29 @@ void QgsDiagramOverlay::drawOverlayObjects( QgsRenderContext& context ) const
135
135
{
136
136
if ( it.value () )
137
137
{
138
- QgsPoint overlayPosition = it.value ()->position ();
138
+ QList< QgsPoint> positionList = it.value ()->positions ();
139
139
const QgsCoordinateTransform* ct = context.coordinateTransform ();
140
- if ( ct )
141
- {
142
- overlayPosition = ct->transform ( overlayPosition );
143
- }
144
- context.mapToPixel ().transform ( &overlayPosition );
145
- int shiftX = currentDiagramImage->width () / 2 ;
146
- int shiftY = currentDiagramImage->height () / 2 ;
147
140
148
- if ( painter )
141
+ QList<QgsPoint>::const_iterator positionIt = positionList.constBegin ();
142
+ for (; positionIt != positionList.constEnd (); ++positionIt)
149
143
{
150
- painter->save ();
151
- painter->scale ( 1.0 / context.rasterScaleFactor (), 1.0 / context.rasterScaleFactor () );
152
- // painter->drawRect(( int )( overlayPosition.x() * context.rasterScaleFactor() ) - shiftX, ( int )( overlayPosition.y() * context.rasterScaleFactor() ) - shiftY, it.value()->width(), it.value()->height());
153
- painter->drawImage (( int )( overlayPosition.x () * context.rasterScaleFactor () ) - shiftX, ( int )( overlayPosition.y () * context.rasterScaleFactor () ) - shiftY, *currentDiagramImage );
154
-
155
- painter->restore ();
144
+ QgsPoint overlayPosition = *positionIt;
145
+ if ( ct )
146
+ {
147
+ overlayPosition = ct->transform (overlayPosition);
148
+ }
149
+ context.mapToPixel ().transform ( &overlayPosition );
150
+ int shiftX = currentDiagramImage->width () / 2 ;
151
+ int shiftY = currentDiagramImage->height () / 2 ;
152
+
153
+ if ( painter )
154
+ {
155
+ painter->save ();
156
+ painter->scale ( 1.0 / context.rasterScaleFactor (), 1.0 / context.rasterScaleFactor () );
157
+ // painter->drawRect(( int )( overlayPosition.x() * context.rasterScaleFactor() ) - shiftX, ( int )( overlayPosition.y() * context.rasterScaleFactor() ) - shiftY, it.value()->width(), it.value()->height());
158
+ painter->drawImage (( int )( overlayPosition.x () * context.rasterScaleFactor () ) - shiftX, ( int )( overlayPosition.y () * context.rasterScaleFactor () ) - shiftY, *currentDiagramImage );
159
+ painter->restore ();
160
+ }
156
161
}
157
162
}
158
163
}
0 commit comments