Skip to content

Commit 95038b1

Browse files
committedMay 18, 2016
scale is the same whatever the level of magnification
1 parent 842be91 commit 95038b1

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed
 

‎src/gui/qgsmapcanvas.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,13 @@ void QgsMapCanvas::setMagnificationFactor( double level )
316316
QgsMapSettings settings = mSettings;
317317
settings.setRotation( 0.0 );
318318

319-
QgsRectangle ext = settings.visibleExtent();
320-
ext.scale( mMagnificationFactor / level );
321-
319+
double ratio = mMagnificationFactor / level;
322320
mMagnificationFactor = level;
323321

322+
QgsRectangle ext = settings.visibleExtent();
323+
ext.scale( ratio );
324+
325+
mSettings.setOutputDpi( mSettings.outputDpi() / ratio );
324326
setExtent( ext, true );
325327

326328
refresh();
@@ -694,17 +696,13 @@ void QgsMapCanvas::refreshMap()
694696

695697
mSettings.setExpressionContext( expressionContext );
696698

697-
// magnify level to use in renderers
698-
QgsMapSettings settings = mSettings;
699-
settings.setOutputDpi( settings.outputDpi() * mMagnificationFactor );
700-
701699
// create the renderer job
702700
Q_ASSERT( !mJob );
703701
mJobCancelled = false;
704702
if ( mUseParallelRendering )
705-
mJob = new QgsMapRendererParallelJob( settings );
703+
mJob = new QgsMapRendererParallelJob( mSettings );
706704
else
707-
mJob = new QgsMapRendererSequentialJob( settings );
705+
mJob = new QgsMapRendererSequentialJob( mSettings );
708706
connect( mJob, SIGNAL( finished() ), SLOT( rendererJobFinished() ) );
709707
mJob->setCache( mCache );
710708

0 commit comments

Comments
 (0)
Please sign in to comment.