(aa84bc3c8) Fixed: UI Scaling issues in 4k

This commit is contained in:
Joonas Rikkonen
2019-05-18 17:36:15 +03:00
parent 30eed1ed7c
commit be4db3ee12
5 changed files with 89 additions and 98 deletions
@@ -91,7 +91,7 @@ namespace Barotrauma
}
InnerFrame.RectTransform.NonScaledSize =
new Point(InnerFrame.Rect.Width, (int)Math.Max(height / Content.RectTransform.RelativeSize.Y, height + 50));
new Point(InnerFrame.Rect.Width, (int)Math.Max(height / Content.RectTransform.RelativeSize.Y, height + (int)(50 * GUI.yScale)));
Content.RectTransform.NonScaledSize =
new Point(Content.Rect.Width, height);
}
@@ -99,7 +99,7 @@ namespace Barotrauma
Buttons = new List<GUIButton>(buttons.Length);
for (int i = 0; i < buttons.Length; i++)
{
var button = new GUIButton(new RectTransform(new Vector2(Math.Min(0.9f / buttons.Length, 0.5f), 1.0f), buttonContainer.RectTransform, maxSize: new Point(300, 35)), buttons[i], style: "GUIButtonLarge");
var button = new GUIButton(new RectTransform(new Vector2(Math.Min(0.9f / buttons.Length, 0.5f), 1.0f), buttonContainer.RectTransform), buttons[i], style: "GUIButtonLarge");
Buttons.Add(button);
}