From a7e262627fe34e05c91497366b67054beb962fd9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 7 Apr 2022 15:13:39 +0900 Subject: [PATCH] Fix `DrawableStoryboardAnimation` not specifying sizing correctly Usually this would be handled by `TextureAnimation`, but because we are inheriting from `DrawableAnimation` here for reasons, we needed to implement this ourselves. Follows the implementation in `TextureAnimation`. --- .../Drawables/DrawableStoryboardAnimation.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs b/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs index 88cb5f40a1..2ef6f28720 100644 --- a/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs +++ b/osu.Game/Storyboards/Drawables/DrawableStoryboardAnimation.cs @@ -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) {