mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 16:43:00 +08:00
Avoid potentially incorrect size adjustment when texture doesn't change
This commit is contained in:
parent
567bc8fcd3
commit
3705c4c8d5
@ -106,11 +106,11 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
|
|
||||||
private void skinSourceChanged()
|
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);
|
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)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
Loading…
Reference in New Issue
Block a user