Skip to content
Permalink
Browse files
Avoid second transform of extent (in QgsMapRender) on change of dest CRS
  • Loading branch information
wonder-sk committed Jun 11, 2014
1 parent 97665d7 commit 0f5d7438e3e732420d9288dc155a636355880cf9
Showing with 5 additions and 5 deletions.
  1. +1 −1 python/core/qgsmaprenderer.sip
  2. +2 −2 src/core/qgsmaprenderer.cpp
  3. +1 −1 src/core/qgsmaprenderer.h
  4. +1 −1 src/gui/qgsmapcanvas.cpp
@@ -221,7 +221,7 @@ class QgsMapRenderer : QObject
bool hasCrsTransformEnabled() const;

//! sets destination coordinate reference system
void setDestinationCrs( const QgsCoordinateReferenceSystem& crs, bool refreshCoordinateTransformInfo = true );
void setDestinationCrs( const QgsCoordinateReferenceSystem& crs, bool refreshCoordinateTransformInfo = true, bool transformExtent = true );

//! returns CRS of destination coordinate reference system
const QgsCoordinateReferenceSystem& destinationCrs() const;
@@ -657,7 +657,7 @@ bool QgsMapRenderer::hasCrsTransformEnabled() const
return mProjectionsEnabled;
}

void QgsMapRenderer::setDestinationCrs( const QgsCoordinateReferenceSystem& crs, bool refreshCoordinateTransformInfo )
void QgsMapRenderer::setDestinationCrs( const QgsCoordinateReferenceSystem& crs, bool refreshCoordinateTransformInfo, bool transformExtent )
{
QgsDebugMsg( "* Setting destCRS : = " + crs.toProj4() );
QgsDebugMsg( "* DestCRS.srsid() = " + QString::number( crs.srsid() ) );
@@ -668,7 +668,7 @@ void QgsMapRenderer::setDestinationCrs( const QgsCoordinateReferenceSystem& crs,
mLayerCoordinateTransformInfo.clear();
}
QgsRectangle rect;
if ( !mExtent.isEmpty() )
if ( transformExtent && !mExtent.isEmpty() )
{
QgsCoordinateTransform transform( *mDestCRS, crs );
rect = transform.transformBoundingBox( mExtent );
@@ -258,7 +258,7 @@ class CORE_EXPORT QgsMapRenderer : public QObject
bool hasCrsTransformEnabled() const;

//! sets destination coordinate reference system
void setDestinationCrs( const QgsCoordinateReferenceSystem& crs, bool refreshCoordinateTransformInfo = true );
void setDestinationCrs( const QgsCoordinateReferenceSystem& crs, bool refreshCoordinateTransformInfo = true, bool transformExtent = true );

//! returns CRS of destination coordinate reference system
const QgsCoordinateReferenceSystem& destinationCrs() const;
@@ -152,7 +152,7 @@ void QgsMapCanvasRendererSync::onCrsTransformR2C()

void QgsMapCanvasRendererSync::onDestCrsC2R()
{
mRenderer->setDestinationCrs( mCanvas->mapSettings().destinationCrs() );
mRenderer->setDestinationCrs( mCanvas->mapSettings().destinationCrs(), true, false );
}

void QgsMapCanvasRendererSync::onDestCrsR2C()

0 comments on commit 0f5d743

Please sign in to comment.