mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Merge pull request #1901 from m-kuhn/fixrendering
Fix rendering position in incremental rendering
This commit is contained in:
commit
96732bb91c
@ -726,7 +726,7 @@ void QgsMapCanvas::rendererJobFinished()
|
||||
|
||||
p.end();
|
||||
|
||||
mMap->setContent( img, imageRect( img ) );
|
||||
mMap->setContent( img, imageRect( img, mJob->mapSettings() ) );
|
||||
}
|
||||
|
||||
// now we are in a slot called from mJob - do not delete it immediately
|
||||
@ -737,11 +737,11 @@ void QgsMapCanvas::rendererJobFinished()
|
||||
emit mapCanvasRefreshed();
|
||||
}
|
||||
|
||||
QgsRectangle QgsMapCanvas::imageRect( const QImage& img )
|
||||
QgsRectangle QgsMapCanvas::imageRect( const QImage& img, const QgsMapSettings& mapSettings )
|
||||
{
|
||||
// This is an hack to pass QgsMapCanvasItem::setRect what it
|
||||
// This is a hack to pass QgsMapCanvasItem::setRect what it
|
||||
// expects (encoding of position and size of the item)
|
||||
const QgsMapToPixel& m2p = mSettings.mapToPixel();
|
||||
const QgsMapToPixel& m2p = mapSettings.mapToPixel();
|
||||
QgsPoint topLeft = m2p.toMapPoint( 0, 0 );
|
||||
double res = m2p.mapUnitsPerPixel();
|
||||
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 )
|
||||
void QgsMapCanvas::mapUpdateTimeout()
|
||||
{
|
||||
const QImage& img = mJob->renderedImage();
|
||||
mMap->setContent( img, imageRect( img ) );
|
||||
mMap->setContent( img, imageRect( img, mJob->mapSettings() ) );
|
||||
}
|
||||
|
||||
void QgsMapCanvas::stopRendering()
|
||||
|
@ -674,7 +674,7 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
|
||||
|
||||
QgsPreviewEffect* mPreviewEffect;
|
||||
|
||||
QgsRectangle imageRect( const QImage& img );
|
||||
QgsRectangle imageRect(const QImage& img , const QgsMapSettings& mapSettings );
|
||||
|
||||
QgsSnappingUtils* mSnappingUtils;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user