Skip to content
Permalink
Browse files
Use devicePixelRatio in dostPerMeter computation
  • Loading branch information
troopa81 authored and github-actions committed Dec 21, 2021
1 parent 8d71acb commit 7364250f55fcf78e7d53cbb3bdef769e67353d70
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/maprenderer/qgsmaprendererjob.cpp
@@ -373,8 +373,8 @@ QImage *QgsMapRendererJob::allocateImage( QString layerId )
QImage *image = new QImage( mSettings.deviceOutputSize(),
mSettings.outputImageFormat() );
image->setDevicePixelRatio( static_cast<qreal>( mSettings.devicePixelRatio() ) );
image->setDotsPerMeterX( 1000 * mSettings.outputDpi() / 25.4 );
image->setDotsPerMeterY( 1000 * mSettings.outputDpi() / 25.4 );
image->setDotsPerMeterX( mSettings.devicePixelRatio() * 1000 * mSettings.outputDpi() / 25.4 );
image->setDotsPerMeterY( mSettings.devicePixelRatio() * 1000 * mSettings.outputDpi() / 25.4 );
if ( image->isNull() )
{
mErrors.append( Error( layerId, tr( "Insufficient memory for image %1x%2" ).arg( mSettings.outputSize().width() ).arg( mSettings.outputSize().height() ) ) );

0 comments on commit 7364250

Please sign in to comment.