Render incremental rendering image at proper location

The old behavior was to render it at the currently visibleExtent based on the
map canvas. The job may however have been scheduled for a different extent and
therefore rendered at an improper location.
This commit is contained in:
Matthias Kuhn 2014-12-11 01:26:43 +01:00
parent 0d8cb3c1a9
commit 2e972b13ba
4 changed files with 20 additions and 2 deletions

View File

@ -89,6 +89,13 @@ class QgsMapRendererJob : QObject
//! Find out how log it took to finish the job (in miliseconds)
int renderingTime() const;
/**
* Return map settings with which this job was started.
* @return A QgsMapSettings instance with render settings
* @note added in 2.8
*/
const QgsMapSettings& mapSettings() const;
signals:
//! emitted when asynchronous rendering is finished (or canceled).

View File

@ -56,6 +56,11 @@ void QgsMapRendererJob::setCache( QgsMapRendererCache* cache )
mCache = cache;
}
const QgsMapSettings& QgsMapRendererJob::mapSettings() const
{
return mSettings;
}
bool QgsMapRendererJob::reprojectToLayerExtent( const QgsCoordinateTransform* ct, bool layerCrsGeographic, QgsRectangle& extent, QgsRectangle& r2 )
{

View File

@ -126,6 +126,13 @@ class CORE_EXPORT QgsMapRendererJob : public QObject
//! Find out how log it took to finish the job (in miliseconds)
int renderingTime() const { return mRenderingTime; }
/**
* Return map settings with which this job was started.
* @return A QgsMapSettings instance with render settings
* @note added in 2.8
*/
const QgsMapSettings& mapSettings() const;
signals:
//! emitted when asynchronous rendering is finished (or canceled).

View File

@ -737,10 +737,9 @@ void QgsMapCanvas::rendererJobFinished()
void QgsMapCanvas::mapUpdateTimeout()
{
mMap->setContent( mJob->renderedImage(), mSettings.visibleExtent() );
mMap->setContent( mJob->renderedImage(), mJob->mapSettings().visibleExtent() );
}
void QgsMapCanvas::stopRendering()
{
if ( mJob )