Fix incorrect osu!catch snap display when last object is a juice stream

Addresses https://github.com/ppy/osu/discussions/29678.
This commit is contained in:
Dean Herbert 2024-09-02 17:26:14 +09:00
parent fb66e9bfa2
commit 171ac0f510
No known key found for this signature in database

View File

@ -18,7 +18,9 @@ namespace osu.Game.Rulesets.Catch.Edit
// The implementation below is probably correct but should be checked if/when exposed via controls.
float expectedDistance = DurationToDistance(before, after.StartTime - before.GetEndTime());
float actualDistance = Math.Abs(((CatchHitObject)before).EffectiveX - ((CatchHitObject)after).EffectiveX);
float previousEndX = (before as JuiceStream)?.EndX ?? ((CatchHitObject)before).EffectiveX;
float actualDistance = Math.Abs(previousEndX - ((CatchHitObject)after).EffectiveX);
return actualDistance / expectedDistance;
}