mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix initial scale counting from dpi.
This commit is contained in:
parent
1326359745
commit
05911a7172
1 changed files with 4 additions and 1 deletions
|
@ -241,7 +241,10 @@ void Sandbox::setupScreenScale() {
|
||||||
// 110% for Retina screens by default.
|
// 110% for Retina screens by default.
|
||||||
cSetScreenScale((useRatio == 2) ? 110 : 100);
|
cSetScreenScale((useRatio == 2) ? 110 : 100);
|
||||||
} else {
|
} else {
|
||||||
const auto clamped = std::clamp(screenScale, 50 * useRatio, 300);
|
const auto clamped = std::clamp(
|
||||||
|
screenScale * useRatio,
|
||||||
|
50 * useRatio,
|
||||||
|
300);
|
||||||
cSetScreenScale(int(base::SafeRound(clamped * 1. / useRatio)));
|
cSetScreenScale(int(base::SafeRound(clamped * 1. / useRatio)));
|
||||||
}
|
}
|
||||||
LOG(("DevicePixelRatio: %1").arg(useRatio));
|
LOG(("DevicePixelRatio: %1").arg(useRatio));
|
||||||
|
|
Loading…
Add table
Reference in a new issue