From 05911a7172d3683de9f9f354493acb86588372ba Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 10 Jan 2023 09:51:12 +0400 Subject: [PATCH] Fix initial scale counting from dpi. --- Telegram/SourceFiles/core/sandbox.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index ac8941087..3de4ebb3b 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -241,7 +241,10 @@ void Sandbox::setupScreenScale() { // 110% for Retina screens by default. cSetScreenScale((useRatio == 2) ? 110 : 100); } 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))); } LOG(("DevicePixelRatio: %1").arg(useRatio));