Skip to content

Commit

Permalink
Ensure that multi-resolution (e.g. xyz tile) layers are correctly
Browse files Browse the repository at this point in the history
represented when magnifying canvas

The tiles should be magnified, not fetched at increasing zoom levels

Fixes #45336
  • Loading branch information
nyalldawson authored and github-actions[bot] committed Jan 14, 2022
1 parent 114c17e commit a0ba1ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -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() );
}
}

Expand Down

0 comments on commit a0ba1ff

Please sign in to comment.