From b0cbb4f9e40cc6d10fb72157348b0cd5ebf24325 Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 9 Dec 2021 17:22:52 +0100 Subject: [PATCH] missing paint device metrics added --- src/graphic/QskGraphic.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/graphic/QskGraphic.cpp b/src/graphic/QskGraphic.cpp index 45e98cb6..84b8fd02 100644 --- a/src/graphic/QskGraphic.cpp +++ b/src/graphic/QskGraphic.cpp @@ -430,7 +430,7 @@ QPaintEngine* QskGraphic::paintEngine() const int QskGraphic::metric( PaintDeviceMetric deviceMetric ) const { - int value; + int value = 0; switch ( deviceMetric ) { @@ -472,9 +472,18 @@ int QskGraphic::metric( PaintDeviceMetric deviceMetric ) const value = qRound( metric( PdmHeight ) * 25.4 / metric( PdmDpiY ) ); break; } - default: - value = 0; + case PdmDevicePixelRatio: + { + value = 1.0; + break; + } + case PdmDevicePixelRatioScaled: + { + value = metric( PdmDevicePixelRatio ) * devicePixelRatioFScale(); + break; + } } + return value; }