diff --git a/Yafc.UI/Core/Window.cs b/Yafc.UI/Core/Window.cs index eb2f0e22..a49586a4 100644 --- a/Yafc.UI/Core/Window.cs +++ b/Yafc.UI/Core/Window.cs @@ -70,7 +70,10 @@ internal static int CalculateUnitsToPixels(int display) { _ = SDL.SDL_GetDisplayDPI(display, out float dpi, out _, out _); _ = SDL.SDL_GetDisplayBounds(display, out var rect); // 82x60 is the minimum screen size in units, plus some for borders - int desiredUnitsToPixels = dpi == 0 ? 13 : MathUtils.Round(dpi / 6.8f); + // DPI bellow 96 is more likely to be incorrectly reported value than desired, + // see discussion in https://github.com/shpaass/yafc-ce/issues/255#issuecomment-2508884418 + // => we treat is as "unknown" and revert to default 100% scaling + int desiredUnitsToPixels = dpi < 96 ? 13 : MathUtils.Round(dpi / 6.8f); if (desiredUnitsToPixels * 82f >= rect.w) { desiredUnitsToPixels = MathUtils.Floor(rect.w / 82f);