Skip to content

Commit

Permalink
Merge pull request #914 from eksime/fix-hidpi-scaling
Browse files Browse the repository at this point in the history
fix high dpi scaling based on Red Artist's comments on discord
  • Loading branch information
dlamkins authored Sep 5, 2023
2 parents 9207068 + 0061dfb commit c136818
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Blish HUD/GameServices/GraphicsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c136818

Please sign in to comment.