mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Make StyleBoxTexture respect UI zoom level (#4165)
This commit is contained in:
@@ -143,7 +143,7 @@ namespace Robust.Client.UserInterface.Controls
|
||||
var panel = _getPanel();
|
||||
var panelBox = new UIBox2(0, headerSize, PixelWidth, PixelHeight);
|
||||
|
||||
panel?.Draw(handle, panelBox);
|
||||
panel?.Draw(handle, panelBox, UIScale);
|
||||
|
||||
var font = _getFont();
|
||||
var boxActive = _getTabBoxActive();
|
||||
@@ -185,10 +185,10 @@ namespace Robust.Client.UserInterface.Controls
|
||||
|
||||
if (box != null)
|
||||
{
|
||||
var drawBox = box.GetEnvelopBox(topLeft, size);
|
||||
var drawBox = box.GetEnvelopBox(topLeft, size, UIScale);
|
||||
boxAdvance = drawBox.Width;
|
||||
box.Draw(handle, drawBox);
|
||||
contentBox = box.GetContentBox(drawBox);
|
||||
box.Draw(handle, drawBox, UIScale);
|
||||
contentBox = box.GetContentBox(drawBox, UIScale);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -223,7 +223,7 @@ namespace Robust.Client.UserInterface.Controls
|
||||
}
|
||||
|
||||
var panel = _getPanel();
|
||||
var panelSize = (panel?.MinimumSize ?? Vector2.Zero) / UIScale;
|
||||
var panelSize = (panel?.MinimumSize ?? Vector2.Zero);
|
||||
|
||||
var contentsSize = availableSize - headerSize - panelSize;
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace Robust.Client.UserInterface.Controls
|
||||
var contentBox = new UIBox2i(0, headerSize, (int) (finalSize.X * UIScale), (int) (finalSize.Y * UIScale));
|
||||
if (panel != null)
|
||||
{
|
||||
contentBox = (UIBox2i) panel.GetContentBox(contentBox);
|
||||
contentBox = (UIBox2i) panel.GetContentBox(contentBox, UIScale);
|
||||
}
|
||||
|
||||
var control = GetChild(_currentTab);
|
||||
@@ -322,6 +322,7 @@ namespace Robust.Client.UserInterface.Controls
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the size of the header, in real pixels
|
||||
[System.Diagnostics.Contracts.Pure]
|
||||
private int _getHeaderSize()
|
||||
{
|
||||
@@ -333,8 +334,8 @@ namespace Robust.Client.UserInterface.Controls
|
||||
var inactive = _getTabBoxInactive();
|
||||
var font = _getFont();
|
||||
|
||||
var activeSize = active?.MinimumSize ?? Vector2.Zero;
|
||||
var inactiveSize = inactive?.MinimumSize ?? Vector2.Zero;
|
||||
var activeSize = (active?.MinimumSize ?? Vector2.Zero) * UIScale;
|
||||
var inactiveSize = (inactive?.MinimumSize ?? Vector2.Zero) * UIScale;
|
||||
|
||||
headerSize = (int) MathF.Max(activeSize.Y, inactiveSize.Y);
|
||||
headerSize += font.GetHeight(UIScale);
|
||||
|
||||
Reference in New Issue
Block a user