From 6e89d41d58c846d557a7e254f426e77039722d74 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Sat, 11 Feb 2023 07:35:33 +0400 Subject: [PATCH] Use variables from style namespace instead of hardcoded scale limits --- Telegram/SourceFiles/core/sandbox.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index aec7dba84..4ae2b7b66 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -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));