Scaling: many improvements and fixes
- radius are not pixels, they should not be scaled - use "screen" instead of "Screen" which helps a lot in some places
This commit is contained in:
parent
eda65a9948
commit
d3be5b760b
43 changed files with 532 additions and 538 deletions
|
|
@ -9,17 +9,14 @@ Singleton {
|
|||
id: root
|
||||
|
||||
// Design screen width
|
||||
readonly property int designScreenWidth: 1920
|
||||
|
||||
// Scaling dampening factor - reduces the scaling effect for higher resolutions
|
||||
readonly property real scalingDampening: 0.2
|
||||
readonly property int designScreenWidth: 2560
|
||||
|
||||
// Automatic scaling based on screen width
|
||||
function scale(currentScreen) {
|
||||
if (currentScreen !== undefined) {
|
||||
var rawRatio = currentScreen.width / designScreenWidth;
|
||||
// Apply dampening to reduce scaling for higher resolutions
|
||||
return Math.min(2.0, 1.0 + (rawRatio - 1.0) * scalingDampening);
|
||||
if (currentScreen.width != 0) {
|
||||
var ratio = currentScreen.width / designScreenWidth;
|
||||
// Limit the final scale range between [0.8...2]
|
||||
return Math.max(0.8, Math.min(2.0, ratio));
|
||||
}
|
||||
return 1.0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue