diff --git a/osu.Game.Rulesets.Osu/Objects/Slider.cs b/osu.Game.Rulesets.Osu/Objects/Slider.cs
index 2f6b5c7e68..39ec753fe1 100644
--- a/osu.Game.Rulesets.Osu/Objects/Slider.cs
+++ b/osu.Game.Rulesets.Osu/Objects/Slider.cs
@@ -46,10 +46,16 @@ namespace osu.Game.Rulesets.Osu.Objects
}
///
- /// The position of the cursor at the point of completion of this .
- /// This is set and used by difficulty calculation.
+ /// The position of the cursor at the point of completion of this if it was hit
+ /// with as few movements as possible. This is set and used by difficulty calculation.
///
- internal Vector2? CursorPosition;
+ internal Vector2? LazyEndPosition;
+
+ ///
+ /// The distance travelled by the cursor upon completion of this if it was hit
+ /// with as few movements as possible. This is set and used by difficulty calculation.
+ ///
+ internal float LazyTravelDistance;
public List RepeatSamples { get; set; } = new List();
public int RepeatCount { get; set; } = 1;
diff --git a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs
index fd58ca9e6b..972677a6f1 100644
--- a/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs
+++ b/osu.Game.Rulesets.Osu/OsuDifficulty/Preprocessing/OsuDifficultyHitObject.cs
@@ -64,15 +64,17 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing
}
Vector2 lastCursorPosition = t[1].StackedPosition;
+ float lastTravelDistance = 0;
var lastSlider = t[1] as Slider;
if (lastSlider != null)
{
computeSliderCursorPosition(lastSlider);
- lastCursorPosition = lastSlider.CursorPosition ?? lastCursorPosition;
+ lastCursorPosition = lastSlider.LazyEndPosition ?? lastCursorPosition;
+ lastTravelDistance = lastSlider.LazyTravelDistance;
}
- Distance = (BaseObject.StackedPosition - lastCursorPosition).Length * scalingFactor;
+ Distance = (lastTravelDistance + (BaseObject.StackedPosition - lastCursorPosition).Length) * scalingFactor;
}
private void setTimingValues()
@@ -84,14 +86,14 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing
private void computeSliderCursorPosition(Slider slider)
{
- if (slider.CursorPosition != null)
+ if (slider.LazyEndPosition != null)
return;
- slider.CursorPosition = slider.StackedPosition;
+ slider.LazyEndPosition = slider.StackedPosition;
float approxFollowCircleRadius = (float)(slider.Radius * 3);
var computeVertex = new Action(t =>
{
- var diff = slider.PositionAt(t) - slider.CursorPosition.Value;
+ var diff = slider.PositionAt(t) - slider.LazyEndPosition.Value;
float dist = diff.Length;
if (dist > approxFollowCircleRadius)
@@ -99,7 +101,8 @@ namespace osu.Game.Rulesets.Osu.OsuDifficulty.Preprocessing
// The cursor would be outside the follow circle, we need to move it
diff.Normalize(); // Obtain direction of diff
dist -= approxFollowCircleRadius;
- slider.CursorPosition += diff * dist;
+ slider.LazyEndPosition += diff * dist;
+ slider.LazyTravelDistance += dist;
}
});