mirror of
https://github.com/ppy/osu.git
synced 2026-05-20 02:39:53 +08:00
Override sprite update method to handle alpha values > 1 like stable.
If alpha exceeds 1 during a sprite's alpha transform like in a FadeTo(), it will set it to 0 mimicking stable's behavior.
This commit is contained in:
committed by
GitHub
Unverified
parent
582ff999aa
commit
4e4aa44a02
@@ -74,6 +74,13 @@ namespace osu.Game.Storyboards.Drawables
|
||||
public override bool IsPresent
|
||||
=> !float.IsNaN(DrawPosition.X) && !float.IsNaN(DrawPosition.Y) && base.IsPresent;
|
||||
|
||||
// Match stable behavior with alpha values > 1 during interpolation (eg. overshoot easings like InOutElastic etc.)
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
if (Alpha > 1) Alpha = 0;
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private ISkinSource skin { get; set; } = null!;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user