Fix TextureRect KeepCentered (#4937)

Easiest way to repro is set a non-1.0 UIScale and open the main menu up, the logo will be fonky.
I checked the control dimensions and this aligned with my expectations.
This commit is contained in:
metalgearsloth
2024-03-06 09:28:28 +11:00
committed by GitHub
parent c55327e1d1
commit 108366152b
2 changed files with 2 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ END TEMPLATE-->
### Bugfixes
*None yet*
* Fix TextureRect alignment where the strech mode is KeepCentered.
### Other

View File

@@ -213,7 +213,7 @@ namespace Robust.Client.UserInterface.Controls
return UIBox2.FromDimensions(Vector2.Zero, TextureSizeTarget * UIScale);
case StretchMode.KeepCentered:
{
var position = (PixelSize - TextureSizeTarget) / 2;
var position = (Size - TextureSizeTarget) / 2;
return UIBox2.FromDimensions(position, TextureSizeTarget * UIScale);
}