Skip to content

Commit

Permalink
scale is the same whatever the level of magnification
Browse files Browse the repository at this point in the history
  • Loading branch information
pblottiere committed May 18, 2016
1 parent 842be91 commit 95038b1
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -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();
Expand Down Expand Up @@ -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 );

Expand Down

0 comments on commit 95038b1

Please sign in to comment.