From 0061dfb9404cb1675f5c70c18b8c56ce91d9762d Mon Sep 17 00:00:00 2001 From: Elliot Sime <5482039+eksime@users.noreply.github.com> Date: Tue, 5 Sep 2023 22:21:03 +0100 Subject: [PATCH] fix high dpi scaling based on Red Artist's comments on discord --- Blish HUD/GameServices/GraphicsService.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Blish HUD/GameServices/GraphicsService.cs b/Blish HUD/GameServices/GraphicsService.cs index 4df83fdb1..30eab9a10 100644 --- a/Blish HUD/GameServices/GraphicsService.cs +++ b/Blish HUD/GameServices/GraphicsService.cs @@ -462,7 +462,13 @@ private void Rescale() { BlishHud.Instance.ActiveGraphicsDeviceManager.PreferredBackBufferWidth, BlishHud.Instance.ActiveGraphicsDeviceManager.PreferredBackBufferHeight); - this.UIScaleMultiplier = GetDpiScaleRatio() * GetScaleRatio(GameService.Gw2Mumble.UI.UISize) * MinimumUnscaledGameResolution.GetAspectRatioScale(backbufferSize); + int integerDpi = (int)GetDpiScaleRatio(); + Point scaledMinimumGameResolution = MinimumUnscaledGameResolution * new Point(integerDpi, integerDpi); + + this.UIScaleMultiplier = GetDpiScaleRatio() + * GetScaleRatio(GameService.Gw2Mumble.UI.UISize) + * scaledMinimumGameResolution.GetAspectRatioScale(backbufferSize); + this.SpriteScreen.Size = backbufferSize.UiToScale(); this.UIScaleTransform = Matrix.CreateScale(this.UIScaleMultiplier);