Use variables from style namespace instead of hardcoded scale limits

This commit is contained in:
Ilya Fedin 2023-02-11 07:35:33 +04:00 committed by John Preston
parent 20f946f657
commit 6e89d41d58
1 changed files with 3 additions and 3 deletions

View File

@ -244,12 +244,12 @@ void Sandbox::setupScreenScale() {
LOG(("Computed screen scale: %1").arg(screenScale));
if (Platform::IsMac()) {
// 110% for Retina screens by default.
cSetScreenScale((useRatio == 2) ? 110 : 100);
cSetScreenScale((useRatio == 2) ? 110 : style::kScaleDefault);
} else {
const auto clamped = std::clamp(
screenScale * useRatio,
50 * useRatio,
300);
style::kScaleMin * useRatio,
style::kScaleMax);
cSetScreenScale(int(base::SafeRound(clamped * 1. / useRatio)));
}
LOG(("DevicePixelRatio: %1").arg(useRatio));