From 95038b143d6dede4cce88aab9d7fc74063e65a5a Mon Sep 17 00:00:00 2001 From: Blottiere Paul Date: Wed, 18 May 2016 11:42:22 +0200 Subject: [PATCH] scale is the same whatever the level of magnification --- src/gui/qgsmapcanvas.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/gui/qgsmapcanvas.cpp b/src/gui/qgsmapcanvas.cpp index 9a5327db5aa..a09cd0999d6 100644 --- a/src/gui/qgsmapcanvas.cpp +++ b/src/gui/qgsmapcanvas.cpp @@ -316,11 +316,13 @@ void QgsMapCanvas::setMagnificationFactor( double level ) QgsMapSettings settings = mSettings; settings.setRotation( 0.0 ); - QgsRectangle ext = settings.visibleExtent(); - ext.scale( mMagnificationFactor / level ); - + double ratio = mMagnificationFactor / level; mMagnificationFactor = level; + QgsRectangle ext = settings.visibleExtent(); + ext.scale( ratio ); + + mSettings.setOutputDpi( mSettings.outputDpi() / ratio ); setExtent( ext, true ); refresh(); @@ -694,17 +696,13 @@ void QgsMapCanvas::refreshMap() mSettings.setExpressionContext( expressionContext ); - // magnify level to use in renderers - QgsMapSettings settings = mSettings; - settings.setOutputDpi( settings.outputDpi() * mMagnificationFactor ); - // create the renderer job Q_ASSERT( !mJob ); mJobCancelled = false; if ( mUseParallelRendering ) - mJob = new QgsMapRendererParallelJob( settings ); + mJob = new QgsMapRendererParallelJob( mSettings ); else - mJob = new QgsMapRendererSequentialJob( settings ); + mJob = new QgsMapRendererSequentialJob( mSettings ); connect( mJob, SIGNAL( finished() ), SLOT( rendererJobFinished() ) ); mJob->setCache( mCache );