Round scaling instead of flooring

This commit is contained in:
Stephen Horvath
2025-09-09 17:39:53 +10:00
parent f50a11deaa
commit 624fed2c71

View File

@@ -2,7 +2,7 @@ import os
if os.name == 'nt' and os.environ.get('GDK_SCALE') is None: if os.name == 'nt' and os.environ.get('GDK_SCALE') is None:
import ctypes import ctypes
scale_factor = ctypes.windll.shcore.GetScaleFactorForDevice(0) scale_factor = ctypes.windll.shcore.GetScaleFactorForDevice(0)
os.environ["GDK_SCALE"] = f"{scale_factor//100}" os.environ["GDK_SCALE"] = f"{round(scale_factor, -2)//100}"
from yafi import main from yafi import main
main() main()