Skip to content

Commit

Permalink
Merge pull request #31825 from peppy/fix-slider-ball-rotation-rewind
Browse files Browse the repository at this point in the history
Fix slider ball rotation not being updated when rewinding to a slider
  • Loading branch information
bdach authored Feb 10, 2025
2 parents cf4c9e7 + 4382245 commit 0e1b580
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions osu.Game.Rulesets.Osu/Objects/Drawables/DrawableSliderBall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@ public void UpdateProgress(double completionProgress)
Slider slider = drawableSlider.HitObject;
Position = slider.CurvePositionAt(completionProgress);

//0.1 / slider.Path.Distance is the additional progress needed to ensure the diff length is 0.1
var diff = slider.CurvePositionAt(completionProgress) - slider.CurvePositionAt(Math.Min(1, completionProgress + 0.1 / slider.Path.Distance));
// 0.1 / slider.Path.Distance is the additional progress needed to ensure the diff length is 0.1
double checkDistance = 0.1 / slider.Path.Distance;
var diff = slider.CurvePositionAt(Math.Min(1 - checkDistance, completionProgress)) - slider.CurvePositionAt(Math.Min(1, completionProgress + checkDistance));

// Ensure the value is substantially high enough to allow for Atan2 to get a valid angle.
// Needed for when near completion, or in case of a very short slider.
Expand Down

0 comments on commit 0e1b580

Please sign in to comment.