diff --git a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs index 672867c607..983373f826 100644 --- a/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs +++ b/osu.Game.Mode.Osu/Objects/Drawables/DrawableSlider.cs @@ -43,8 +43,8 @@ namespace osu.Game.Modes.Osu.Objects.Drawables { base.LoadComplete(); - for (int i = 0; i < slider.Curve.Path.Count; ++i) - path.Positions.Add(slider.Curve.Path[i]); + for (int i = 0; i < slider.Curve.Length; i += 10) + path.Positions.Add(slider.Curve.PositionAt(i / slider.Curve.Length)); path.PathWidth = startCircle.DrawWidth / 4; diff --git a/osu.Game.Mode.Osu/Objects/Slider.cs b/osu.Game.Mode.Osu/Objects/Slider.cs index 114b87eaaf..08ee732cd2 100644 --- a/osu.Game.Mode.Osu/Objects/Slider.cs +++ b/osu.Game.Mode.Osu/Objects/Slider.cs @@ -44,11 +44,13 @@ namespace osu.Game.Modes.Osu.Objects public Vector2 PositionAt(double progress) { - int index = (int)(progress * (calculatedPath.Count - 1)); + progress = MathHelper.Clamp(progress, 0, 1); - Vector2 pos = calculatedPath[index]; - if (index != progress) - pos += (calculatedPath[index + 1] - pos) * (float)(progress - index); + double index = progress * (calculatedPath.Count - 1); + + Vector2 pos = calculatedPath[(int)index]; + if (index != (int)index) + pos += (calculatedPath[(int)index + 1] - pos) * (float)(index - (int)index); return pos; }