Skip to content
Permalink
Browse files
Use devicePixelRatio in dostPerMeter computation
  • Loading branch information
troopa81 authored and nyalldawson committed Dec 21, 2021
1 parent 964bccf commit 4c9c494e460125f4e227467147626897b62b291d
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/maprenderer/qgsmaprendererjob.cpp
@@ -374,8 +374,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 4c9c494

Please sign in to comment.