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 committed Jan 14, 2022
1 parent e41e487 commit e39f980
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gui/qgsmapcanvas.cpp
Expand Up @@ -1063,12 +1063,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 e39f980

Please sign in to comment.