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

View file

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