Fix osu!catch fruits not resizing on texture change

This commit is contained in:
Dan Balasescu 2024-09-02 15:23:40 +09:00
parent e79604cc13
commit 30fb3c3999
No known key found for this signature in database
1 changed files with 19 additions and 3 deletions

View File

@ -85,9 +85,25 @@ protected override void LoadComplete()
protected void SetTexture(Texture? texture, Texture? overlayTexture)
{
// Sizes are reset due to an arguable osu!framework bug where Sprite retains the size of the first set 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;
}
}
}
}