1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 21:27:24 +08:00

Avoid potentially incorrect size adjustment when texture doesn't change

This commit is contained in:
Dean Herbert 2023-09-27 17:16:45 +09:00
parent 567bc8fcd3
commit 3705c4c8d5

View File

@ -106,11 +106,11 @@ namespace osu.Game.Storyboards.Drawables
private void skinSourceChanged()
{
// Setting texture will only update the size if it's zero.
// So let's force an update by setting to zero.
Size = Vector2.Zero;
Texture = skin.GetTexture(Sprite.Path) ?? textureStore.Get(Sprite.Path);
// Setting texture will only update the size if it's zero.
// So let's force an explicit update.
Size = new Vector2(Texture.DisplayWidth, Texture.DisplayHeight);
}
protected override void Dispose(bool isDisposing)