@@ -70,17 +70,17 @@ void QgsMapCanvasMap::paint( QPainter *painter )
70
70
71
71
/* Offset between 0/0 and mRect.xMinimum/mRect.yMinimum.
72
72
We need to consider the offset, because mRect is not updated yet and there might be an offset*/
73
- QgsPoint pt = toMapCoordinates ( QPoint ( 0 , 0 ) );
73
+ QgsPointXY pt = toMapCoordinates ( QPoint ( 0 , 0 ) );
74
74
double offsetX = pt.x () - mRect .xMinimum ();
75
75
double offsetY = pt.y () - mRect .yMaximum ();
76
76
77
77
// draw preview images first
78
- QMap< QgsRectangle, QImage > ::const_iterator previewIt = mPreviewImages .constBegin ();
79
- for ( ; previewIt != mPreviewImages .constEnd (); ++previewIt )
78
+ QList< QPair< QImage, QgsRectangle > > ::const_iterator imIt = mPreviewImages .constBegin ();
79
+ for ( ; imIt != mPreviewImages .constEnd (); ++imIt )
80
80
{
81
- QPointF ul = toCanvasCoordinates ( QgsPoint ( previewIt. key (). xMinimum () + offsetX, previewIt. key () .yMaximum () + offsetY ) );
82
- QPointF lr = toCanvasCoordinates ( QgsPoint ( previewIt. key (). xMaximum () + offsetX, previewIt. key () .yMinimum () + offsetY ) );
83
- painter->drawImage ( QRectF ( ul.x (), ul.y (), lr.x () - ul.x (), lr.y () - ul.y () ), previewIt. value () , QRect ( 0 , 0 , previewIt. value (). width (), previewIt. value () .height () ) );
81
+ QPointF ul = toCanvasCoordinates ( QgsPoint ( imIt-> second . xMinimum () + offsetX, imIt-> second .yMaximum () + offsetY ) );
82
+ QPointF lr = toCanvasCoordinates ( QgsPoint ( imIt-> second . xMaximum () + offsetX, imIt-> second .yMinimum () + offsetY ) );
83
+ painter->drawImage ( QRectF ( ul.x (), ul.y (), lr.x () - ul.x (), lr.y () - ul.y () ), imIt-> first , QRect ( 0 , 0 , imIt-> first . width (), imIt-> first .height () ) );
84
84
}
85
85
86
86
painter->drawImage ( QRect ( 0 , 0 , w, h ), mImage );
0 commit comments