@@ -726,7 +726,7 @@ void QgsMapCanvas::rendererJobFinished()
726
726
727
727
p.end ();
728
728
729
- mMap ->setContent ( img, imageRect ( img ) );
729
+ mMap ->setContent ( img, imageRect ( img, mJob -> mapSettings () ) );
730
730
}
731
731
732
732
// now we are in a slot called from mJob - do not delete it immediately
@@ -737,11 +737,11 @@ void QgsMapCanvas::rendererJobFinished()
737
737
emit mapCanvasRefreshed ();
738
738
}
739
739
740
- QgsRectangle QgsMapCanvas::imageRect ( const QImage& img )
740
+ QgsRectangle QgsMapCanvas::imageRect ( const QImage& img, const QgsMapSettings& mapSettings )
741
741
{
742
- // This is an hack to pass QgsMapCanvasItem::setRect what it
742
+ // This is a hack to pass QgsMapCanvasItem::setRect what it
743
743
// expects (encoding of position and size of the item)
744
- const QgsMapToPixel& m2p = mSettings .mapToPixel ();
744
+ const QgsMapToPixel& m2p = mapSettings .mapToPixel ();
745
745
QgsPoint topLeft = m2p.toMapPoint ( 0 , 0 );
746
746
double res = m2p.mapUnitsPerPixel ();
747
747
QgsRectangle rect ( topLeft.x (), topLeft.y (), topLeft.x () + img.width ()*res, topLeft.y () - img.height ()*res );
@@ -751,7 +751,7 @@ QgsRectangle QgsMapCanvas::imageRect( const QImage& img )
751
751
void QgsMapCanvas::mapUpdateTimeout ()
752
752
{
753
753
const QImage& img = mJob ->renderedImage ();
754
- mMap ->setContent ( img, imageRect ( img ) );
754
+ mMap ->setContent ( img, imageRect ( img, mJob -> mapSettings () ) );
755
755
}
756
756
757
757
void QgsMapCanvas::stopRendering ()
0 commit comments