2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Round system scale in step of 5 points, just like in settings

This commit is contained in:
Ilya Fedin
2023-02-11 07:36:21 +04:00
committed by John Preston
parent 6e89d41d58
commit 0b100884fc

View File

@@ -239,7 +239,7 @@ void Sandbox::setupScreenScale() {
const auto basePair = screen->handle()->logicalBaseDpi();
const auto base = (basePair.first + basePair.second) * 0.5;
const auto screenScaleExact = dpi / base;
const auto screenScale = int(base::SafeRound(screenScaleExact * 4)) * 25;
const auto screenScale = int(base::SafeRound(screenScaleExact * 20)) * 5;
LOG(("Primary screen DPI: %1, Base: %2.").arg(dpi).arg(base));
LOG(("Computed screen scale: %1").arg(screenScale));
if (Platform::IsMac()) {