mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
scale is the same whatever the level of magnification
This commit is contained in:
parent
842be91e61
commit
95038b143d
@ -316,11 +316,13 @@ void QgsMapCanvas::setMagnificationFactor( double level )
|
|||||||
QgsMapSettings settings = mSettings;
|
QgsMapSettings settings = mSettings;
|
||||||
settings.setRotation( 0.0 );
|
settings.setRotation( 0.0 );
|
||||||
|
|
||||||
QgsRectangle ext = settings.visibleExtent();
|
double ratio = mMagnificationFactor / level;
|
||||||
ext.scale( mMagnificationFactor / level );
|
|
||||||
|
|
||||||
mMagnificationFactor = level;
|
mMagnificationFactor = level;
|
||||||
|
|
||||||
|
QgsRectangle ext = settings.visibleExtent();
|
||||||
|
ext.scale( ratio );
|
||||||
|
|
||||||
|
mSettings.setOutputDpi( mSettings.outputDpi() / ratio );
|
||||||
setExtent( ext, true );
|
setExtent( ext, true );
|
||||||
|
|
||||||
refresh();
|
refresh();
|
||||||
@ -694,17 +696,13 @@ void QgsMapCanvas::refreshMap()
|
|||||||
|
|
||||||
mSettings.setExpressionContext( expressionContext );
|
mSettings.setExpressionContext( expressionContext );
|
||||||
|
|
||||||
// magnify level to use in renderers
|
|
||||||
QgsMapSettings settings = mSettings;
|
|
||||||
settings.setOutputDpi( settings.outputDpi() * mMagnificationFactor );
|
|
||||||
|
|
||||||
// create the renderer job
|
// create the renderer job
|
||||||
Q_ASSERT( !mJob );
|
Q_ASSERT( !mJob );
|
||||||
mJobCancelled = false;
|
mJobCancelled = false;
|
||||||
if ( mUseParallelRendering )
|
if ( mUseParallelRendering )
|
||||||
mJob = new QgsMapRendererParallelJob( settings );
|
mJob = new QgsMapRendererParallelJob( mSettings );
|
||||||
else
|
else
|
||||||
mJob = new QgsMapRendererSequentialJob( settings );
|
mJob = new QgsMapRendererSequentialJob( mSettings );
|
||||||
connect( mJob, SIGNAL( finished() ), SLOT( rendererJobFinished() ) );
|
connect( mJob, SIGNAL( finished() ), SLOT( rendererJobFinished() ) );
|
||||||
mJob->setCache( mCache );
|
mJob->setCache( mCache );
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user