diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-04-16 08:26:40 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-04-16 08:26:40 -0700 |
commit | 972819d77afdbfc38af384bb38123671dc522e54 (patch) | |
tree | 512d86878df0cae3df413df5488e37d7bd2a4021 /mobile-widgets | |
parent | 20f525ceddbeee225c444c8cc0158004562b20df (diff) | |
download | subsurface-972819d77afdbfc38af384bb38123671dc522e54.tar.gz |
QML UI: more fine tuning of the magic shift factor
Now it should also work on devices with device pixel ratios of
1.3, 1.33, or 1.4.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r-- | mobile-widgets/qmlprofile.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mobile-widgets/qmlprofile.cpp b/mobile-widgets/qmlprofile.cpp index 855e798b5..5dca74a54 100644 --- a/mobile-widgets/qmlprofile.cpp +++ b/mobile-widgets/qmlprofile.cpp @@ -40,7 +40,7 @@ void QMLProfile::paint(QPainter *painter) double dpr = devicePixelRatio(); double magicValues[] = { 0.0, 0.1, 0.25, 0.33, 0.375, 0.40, 0.42}; qreal magicShiftFactor = 0.0; - if (dpr < 1.5) { + if (dpr < 1.3) { magicShiftFactor = magicValues[0]; } else if (dpr > 6.0) { magicShiftFactor = magicValues[6]; @@ -49,6 +49,8 @@ void QMLProfile::paint(QPainter *painter) } else { int lower = (int)dpr; magicShiftFactor = (magicValues[lower] * (lower + 1 - dpr) + magicValues[lower + 1] * (dpr - lower)); + if (dpr < 1.45) + magicShiftFactor -= 0.03; } // now set up the transformations scale the profile and // shift the painter (taking its existing transformation into account) |