Merge pull request #17701 from peppy/fix-storyboard-animation-sizing

Fix storyboard animations getting incorrect positioning due to size not being set
This commit is contained in:
Dan Balasescu 2022-04-07 17:00:39 +09:00 committed by GitHub
commit 5af93bd85d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -5,8 +5,10 @@
using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Animations;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.Utils;
using osu.Game.Skinning;
using osuTK;
namespace osu.Game.Storyboards.Drawables
@ -88,6 +90,14 @@ public DrawableStoryboardAnimation(StoryboardAnimation animation)
LifetimeEnd = animation.EndTime;
}
protected override Vector2 GetCurrentDisplaySize()
{
Texture texture = (CurrentFrame as Sprite)?.Texture
?? ((CurrentFrame as SkinnableSprite)?.Drawable as Sprite)?.Texture;
return new Vector2(texture?.DisplayWidth ?? 0, texture?.DisplayHeight ?? 0);
}
[BackgroundDependencyLoader]
private void load(TextureStore textureStore, Storyboard storyboard)
{