1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 19:23:22 +08:00

Fix slider ball not animating fade/scale after rewinding

Fixes #1455
This commit is contained in:
smoogipoo 2017-11-03 15:58:12 +09:00
parent 60048e6cd1
commit 5fd3115142

View File

@ -101,14 +101,21 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
// If the current time is between the start and end of the slider, we should track mouse input regardless of the cursor position.
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => canCurrentlyTrack || base.ReceiveMouseInputAt(screenSpacePos);
public override void ClearTransforms(bool propagateChildren = false, string targetMember = null)
{
// Consider the case of rewinding - children's transforms are handled internally, so propagating down
// any further will cause weirdness with the Tracking bool below. Let's not propagate further at this point.
base.ClearTransforms(false, targetMember);
}
private bool tracking;
public bool Tracking
{
get { return tracking; }
private set
{
if (value == tracking) return;
if (value == tracking)
return;
tracking = value;
follow.ScaleTo(tracking ? 2.8f : 1, 300, Easing.OutQuint);
@ -123,8 +130,10 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables.Pieces
base.Update();
// Make sure to use the base version of ReceiveMouseInputAt so that we correctly check the position.
if (Time.Current < slider.EndTime)
Tracking = canCurrentlyTrack && lastState != null && base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position) && ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);
Tracking = canCurrentlyTrack
&& lastState != null
&& base.ReceiveMouseInputAt(lastState.Mouse.NativeState.Position)
&& ((Parent as DrawableSlider)?.OsuActionInputManager?.PressedActions.Any(x => x == OsuAction.LeftButton || x == OsuAction.RightButton) ?? false);
}
public void UpdateProgress(double progress, int repeat)