Skip to content
Permalink
Browse files

Fix incorrect dpi used to render text format previews on qt 5.15

  • Loading branch information
nyalldawson committed Mar 31, 2021
1 parent 7715a12 commit 2a1ab9b3187ccfbcf216b802e6c7f4cdd9a96543
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/labeling/qgspallabeling.cpp
  2. +1 −1 src/core/textrenderer/qgstextformat.cpp
@@ -1309,7 +1309,7 @@ QPixmap QgsPalLayerSettings::labelSettingsPreviewPixmap( const QgsPalLayerSettin
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
const double logicalDpiX = QgsApplication::desktop()->logicalDpiX();
#else
const double logicalDpiX = QApplication::topLevelWidgets().first()->screen()->devicePixelRatio();
const double logicalDpiX = QApplication::topLevelWidgets().first()->screen()->logicalDotsPerInchX();
#endif
context.setScaleFactor( logicalDpiX / 25.4 );

@@ -963,7 +963,7 @@ QPixmap QgsTextFormat::textFormatPreviewPixmap( const QgsTextFormat &format, QSi
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
const double logicalDpiX = QgsApplication::desktop()->logicalDpiX();
#else
const double logicalDpiX = QApplication::topLevelWidgets().first()->screen()->devicePixelRatio();
const double logicalDpiX = QApplication::topLevelWidgets().first()->screen()->logicalDotsPerInchX();
#endif
context.setScaleFactor( logicalDpiX / 25.4 );

0 comments on commit 2a1ab9b

Please sign in to comment.