mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 15:22:55 +08:00
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`.
This commit is contained in:
parent
04235ca76e
commit
a7e262627f
@ -5,8 +5,10 @@ using System;
|
|||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Animations;
|
using osu.Framework.Graphics.Animations;
|
||||||
|
using osu.Framework.Graphics.Sprites;
|
||||||
using osu.Framework.Graphics.Textures;
|
using osu.Framework.Graphics.Textures;
|
||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
|
using osu.Game.Skinning;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
|
|
||||||
namespace osu.Game.Storyboards.Drawables
|
namespace osu.Game.Storyboards.Drawables
|
||||||
@ -88,6 +90,14 @@ namespace osu.Game.Storyboards.Drawables
|
|||||||
LifetimeEnd = animation.EndTime;
|
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]
|
[BackgroundDependencyLoader]
|
||||||
private void load(TextureStore textureStore, Storyboard storyboard)
|
private void load(TextureStore textureStore, Storyboard storyboard)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user