1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 21:02:56 +08:00

Merge pull request #29681 from peppy/fix-catch-snap-value

Fix incorrect osu!catch snap display when last object is a juice stream
This commit is contained in:
Dan Balasescu 2024-09-02 18:33:32 +09:00 committed by GitHub
commit 282c42d9c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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;
}