diff --git a/python/core/qgsmaprendererjob.sip b/python/core/qgsmaprendererjob.sip index e355cbef2419..9c2dcaf9d5e3 100644 --- a/python/core/qgsmaprendererjob.sip +++ b/python/core/qgsmaprendererjob.sip @@ -110,7 +110,7 @@ class QgsMapRendererJob : QObject * source CRS coordinates, and if it was split, returns true, and * also sets the contents of the r2 parameter */ - static bool reprojectToLayerExtent( const QgsCoordinateTransform* ct, bool layerCrsGeographic, QgsRectangle& extent, QgsRectangle& r2 ); + static bool reprojectToLayerExtent( const QgsMapLayer *ml, const QgsCoordinateTransform *ct, QgsRectangle &extent, QgsRectangle &r2 ); //! @note not available in python bindings // LayerRenderJobs prepareJobs( QPainter* painter, QgsPalLabeling* labelingEngine ); diff --git a/src/core/qgsmaprenderercustompainterjob.cpp b/src/core/qgsmaprenderercustompainterjob.cpp index 7997472d89e5..a870c5eda415 100644 --- a/src/core/qgsmaprenderercustompainterjob.cpp +++ b/src/core/qgsmaprenderercustompainterjob.cpp @@ -331,7 +331,7 @@ void QgsMapRendererJob::drawOldLabeling( const QgsMapSettings& settings, QgsRend { ct = settings.layerTransform( ml ); if ( ct ) - reprojectToLayerExtent( ct, ml->crs().geographicFlag(), r1, r2 ); + reprojectToLayerExtent( ml, ct, r1, r2 ); } renderContext.setCoordinateTransform( ct ); diff --git a/src/core/qgsmaprendererjob.cpp b/src/core/qgsmaprendererjob.cpp index 7066d1d6cc14..842d88d8bc3f 100644 --- a/src/core/qgsmaprendererjob.cpp +++ b/src/core/qgsmaprendererjob.cpp @@ -63,7 +63,7 @@ const QgsMapSettings& QgsMapRendererJob::mapSettings() const } -bool QgsMapRendererJob::reprojectToLayerExtent( const QgsCoordinateTransform* ct, bool layerCrsGeographic, QgsRectangle& extent, QgsRectangle& r2 ) +bool QgsMapRendererJob::reprojectToLayerExtent( const QgsMapLayer *ml, const QgsCoordinateTransform *ct, QgsRectangle &extent, QgsRectangle &r2 ) { bool split = false; @@ -79,9 +79,9 @@ bool QgsMapRendererJob::reprojectToLayerExtent( const QgsCoordinateTransform* ct // extent separately. static const double splitCoord = 180.0; - if ( layerCrsGeographic ) + if ( ml->crs().geographicFlag() ) { - if ( !ct->destCRS().geographicFlag() ) + if ( ml->type() == QgsMapLayer::VectorLayer && !ct->destCRS().geographicFlag() ) { // if we transform from a projected coordinate system check // check if transforming back roughly returns the input @@ -221,7 +221,7 @@ LayerRenderJobs QgsMapRendererJob::prepareJobs( QPainter* painter, QgsPalLabelin ct = mSettings.layerTransform( ml ); if ( ct ) { - reprojectToLayerExtent( ct, ml->crs().geographicFlag(), r1, r2 ); + reprojectToLayerExtent( ml, ct, r1, r2 ); } QgsDebugMsg( "extent: " + r1.toString() ); if ( !r1.isFinite() || !r2.isFinite() ) diff --git a/src/core/qgsmaprendererjob.h b/src/core/qgsmaprendererjob.h index 9d86c32be752..ac26c2aaea09 100644 --- a/src/core/qgsmaprendererjob.h +++ b/src/core/qgsmaprendererjob.h @@ -147,7 +147,7 @@ class CORE_EXPORT QgsMapRendererJob : public QObject * source CRS coordinates, and if it was split, returns true, and * also sets the contents of the r2 parameter */ - static bool reprojectToLayerExtent( const QgsCoordinateTransform* ct, bool layerCrsGeographic, QgsRectangle& extent, QgsRectangle& r2 ); + static bool reprojectToLayerExtent( const QgsMapLayer *ml, const QgsCoordinateTransform *ct, QgsRectangle &extent, QgsRectangle &r2 ); //! @note not available in python bindings LayerRenderJobs prepareJobs( QPainter* painter, QgsPalLabeling* labelingEngine, QgsLabelingEngineV2* labelingEngine2 );