Skip to content
Permalink
Browse files

Limit extent reprojection workaround to vector layers (followup 51fe632

…; fixes #13735; refs #7596)
  • Loading branch information
jef-n committed Nov 12, 2015
1 parent fd9f0b5 commit d8f5dbeb4e7ab81326a400eaec05855ff1a38769
@@ -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 );
@@ -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 );
@@ -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() )
@@ -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 );

0 comments on commit d8f5dbe

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