From c3e43a78f330dfb34b1f1b5c0fc4b2e6c2c0a0af Mon Sep 17 00:00:00 2001 From: Nemanja <98561806+EmoGarbage404@users.noreply.github.com> Date: Thu, 17 Apr 2025 22:15:31 -0400 Subject: [PATCH] Fix another storedSprite bug (#36662) --- .../UserInterface/Systems/Storage/Controls/ItemGridPiece.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs b/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs index 92035ba8d9..d07db112c8 100644 --- a/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs +++ b/Content.Client/UserInterface/Systems/Storage/Controls/ItemGridPiece.cs @@ -172,14 +172,16 @@ public sealed class ItemGridPiece : Control, IEntityControl if (itemComponent.StoredSprite is { } storageSprite) { var scale = 2 * UIScale; - var offset = (((Box2) boundingGrid).Size - Vector2.One) * size + iconOffset; var sprite = _entityManager.System().Frame0(storageSprite); + var sizeDifference = ((boundingGrid.Size + Vector2i.One) * _centerTexture.Size * 2 - sprite.Size) * UIScale; + var spriteBox = new Box2Rotated(new Box2(0f, sprite.Height * scale, sprite.Width * scale, 0f), -iconRotation, Vector2.Zero); var root = spriteBox.CalcBoundingBox().BottomLeft; var pos = PixelPosition * 2 + (Parent?.GlobalPixelPosition ?? Vector2.Zero) - + offset; + + sizeDifference + + iconOffset; handle.SetTransform(pos, iconRotation); var box = new UIBox2(root, root + sprite.Size * scale); -- 2.51.2