Skip to content
Permalink
Browse files
Merge pull request #46830 from qgis/backport-46816-to-release-3_22
  • Loading branch information
m-kuhn committed Jan 14, 2022
2 parents b9b7fb9 + a0ba1ff commit 9c5f8e2625661efb9666447eb6a4821a9a53b28b
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/gui/qgsmapcanvas.cpp
@@ -1044,12 +1044,16 @@ void QgsMapCanvas::updateDevicePixelFromScreen()
if ( QgsSettingsRegistryGui::settingsRespectScreenDPI.value() )
{
if ( window()->windowHandle() )
{
mSettings.setOutputDpi( window()->windowHandle()->screen()->physicalDotsPerInch() );
mSettings.setDpiTarget( window()->windowHandle()->screen()->physicalDotsPerInch() );
}
}
else
{
// Fallback: compatibility with QGIS <= 3.20; always assume low dpi screens
mSettings.setOutputDpi( window()->windowHandle()->screen()->logicalDotsPerInch() );
mSettings.setDpiTarget( window()->windowHandle()->screen()->logicalDotsPerInch() );
}
}

0 comments on commit 9c5f8e2

Please sign in to comment.