aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2019-06-28 08:54:24 +0200
committerAndy Shaw <andy.shaw@qt.io>2019-07-03 12:43:46 +0200
commitf9664053132affe48a069235eb6561a32d38b2a7 (patch)
tree956d02bb8ec0b85acddfb171565f5f5d9db6c7b9
parentc8ba132f6ca78f63440f21e9a18f9e90f62377f1 (diff)
Account for the device pixel ratio when showing a DropShadow
The radius and samples needs to be multiplied by the device pixel ratio so that it looks as it would if it was on a non HighDpi screen. So the size of the shadow still looks the same size and as good. Change-Id: Ifa87ec6fad5cdded1a7b1888b2e8c74bcc3f0b54 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/effects/private/DropShadowBase.qml5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/effects/private/DropShadowBase.qml b/src/effects/private/DropShadowBase.qml
index 7e80e47..e9927ea 100644
--- a/src/effects/private/DropShadowBase.qml
+++ b/src/effects/private/DropShadowBase.qml
@@ -38,6 +38,7 @@
****************************************************************************/
import QtQuick 2.12
+import QtQuick.Window 2.12
import QtGraphicalEffects.private 1.12
import QtGraphicalEffects 1.12
@@ -61,8 +62,8 @@ Item {
x: Math.round(horizontalOffset)
y: Math.round(verticalOffset)
source: root.source
- radius: root.radius
- samples: root.samples
+ radius: root.radius * Screen.devicePixelRatio
+ samples: root.samples * Screen.devicePixelRatio
_thickness: root.spread
transparentBorder: root.transparentBorder