mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
20f525cedd
commit
972819d77a
1 changed files with 3 additions and 1 deletions
|
@ -40,7 +40,7 @@ void QMLProfile::paint(QPainter *painter)
|
||||||
double dpr = devicePixelRatio();
|
double dpr = devicePixelRatio();
|
||||||
double magicValues[] = { 0.0, 0.1, 0.25, 0.33, 0.375, 0.40, 0.42};
|
double magicValues[] = { 0.0, 0.1, 0.25, 0.33, 0.375, 0.40, 0.42};
|
||||||
qreal magicShiftFactor = 0.0;
|
qreal magicShiftFactor = 0.0;
|
||||||
if (dpr < 1.5) {
|
if (dpr < 1.3) {
|
||||||
magicShiftFactor = magicValues[0];
|
magicShiftFactor = magicValues[0];
|
||||||
} else if (dpr > 6.0) {
|
} else if (dpr > 6.0) {
|
||||||
magicShiftFactor = magicValues[6];
|
magicShiftFactor = magicValues[6];
|
||||||
|
@ -49,6 +49,8 @@ void QMLProfile::paint(QPainter *painter)
|
||||||
} else {
|
} else {
|
||||||
int lower = (int)dpr;
|
int lower = (int)dpr;
|
||||||
magicShiftFactor = (magicValues[lower] * (lower + 1 - dpr) + magicValues[lower + 1] * (dpr - lower));
|
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
|
// now set up the transformations scale the profile and
|
||||||
// shift the painter (taking its existing transformation into account)
|
// shift the painter (taking its existing transformation into account)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue