[QGIS-Developer] Map canvas displays at wrong scale (logical vs physical dpi)

Martin Pergler pergler at gmail.com
Thu Jan 28 12:56:31 PST 2021


I posted this as a bug at https://github.com/qgis/QGIS/issues/41248 and
Giovanni Manghi suggested I bring it here.

For a lot of users, QGIS currently shows the main map canvas at the wrong
scale, whenever their systemwide "display scaling"(=logical dpi) doesn't
match their screen's physical dpi. It's disconcerting side-by-side with a
printed map, and just incorrect. We can do better, since Qt exposes both
logical and physical dpi. But fixing it would change on-screen behaviour
users are accustomed to.

I think the right solution is to continue using logical DPI for QGIS UI
elements, but initialize mapCanvas().mapSettings().outputDPI() from
iface.mainWindow().physicalDpiX() rather than .logicalDpiX(). And to make
this change opt-in via a setting in Options / Canvas & Legend called
something like "Render canvas at", with a choice of"System DPI" (=logical
DPI), "Physical screen DPI", or a user-defined DPI (since I'm sure some
external monitors will have physical DPI wrong). 

More details at https://github.com/qgis/QGIS/issues/41248
Comments welcome here or there; I know this will be a bit controversial
since we've all gotten used to the "wrong" way on our screens!



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html


More information about the QGIS-Developer mailing list