1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 02:52:54 +08:00

Merge pull request #29679 from smoogipoo/fix-fruit-sprite-size

Fix osu!catch fruits not resizing on texture change
This commit is contained in:
Bartłomiej Dach 2024-09-02 09:16:27 +02:00 committed by GitHub
commit fb66e9bfa2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -85,9 +85,25 @@ namespace osu.Game.Rulesets.Catch.Skinning.Legacy
protected void SetTexture(Texture? texture, Texture? overlayTexture) protected void SetTexture(Texture? texture, Texture? overlayTexture)
{ {
colouredSprite.Texture = texture; // Sizes are reset due to an arguable osu!framework bug where Sprite retains the size of the first set texture.
overlaySprite.Texture = overlayTexture;
hyperSprite.Texture = texture; if (colouredSprite.Texture != texture)
{
colouredSprite.Size = Vector2.Zero;
colouredSprite.Texture = texture;
}
if (overlaySprite.Texture != overlayTexture)
{
overlaySprite.Size = Vector2.Zero;
overlaySprite.Texture = overlayTexture;
}
if (hyperSprite.Texture != texture)
{
hyperSprite.Size = Vector2.Zero;
hyperSprite.Texture = texture;
}
} }
} }
} }