Skip to content
Permalink
Browse files

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.
  • Loading branch information
m-kuhn committed Dec 11, 2014
1 parent 0d8cb3c commit 2e972b13bad1f80042715a4cb8472c2016d4cb19
Showing with 20 additions and 2 deletions.
  1. +7 −0 python/core/qgsmaprendererjob.sip
  2. +5 −0 src/core/qgsmaprendererjob.cpp
  3. +7 −0 src/core/qgsmaprendererjob.h
  4. +1 −2 src/gui/qgsmapcanvas.cpp
@@ -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).
@@ -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 )
{
@@ -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).
@@ -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 )

0 comments on commit 2e972b1

Please sign in to comment.
You can’t perform that action at this time.