1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 22:33:05 +08:00

Remove incorrect double multiplication and add missing test coverage

This commit is contained in:
Dean Herbert 2022-11-01 17:14:30 +09:00
parent d807d9d822
commit 29bc653d24
2 changed files with 4 additions and 1 deletions

View File

@ -125,6 +125,9 @@ namespace osu.Game.Tests.Editing
assertSnapDistance(base_distance * slider_velocity, referenceObject, true); assertSnapDistance(base_distance * slider_velocity, referenceObject, true);
assertSnappedDistance(base_distance * slider_velocity + 10, base_distance * slider_velocity, referenceObject); assertSnappedDistance(base_distance * slider_velocity + 10, base_distance * slider_velocity, referenceObject);
assertSnappedDuration(base_distance * slider_velocity + 10, 1000, referenceObject); assertSnappedDuration(base_distance * slider_velocity + 10, 1000, referenceObject);
assertDistanceToDuration(base_distance * slider_velocity, 1000, referenceObject);
assertDurationToDistance(1000, base_distance * slider_velocity, referenceObject);
} }
[Test] [Test]

View File

@ -273,7 +273,7 @@ namespace osu.Game.Rulesets.Edit
public virtual double DistanceToDuration(HitObject referenceObject, float distance) public virtual double DistanceToDuration(HitObject referenceObject, float distance)
{ {
double beatLength = BeatSnapProvider.GetBeatLengthAtTime(referenceObject.StartTime); double beatLength = BeatSnapProvider.GetBeatLengthAtTime(referenceObject.StartTime);
return distance / GetBeatSnapDistanceAt(referenceObject) * beatLength * referenceObject.DifficultyControlPoint.SliderVelocity; return distance / GetBeatSnapDistanceAt(referenceObject) * beatLength;
} }
public virtual double FindSnappedDuration(HitObject referenceObject, float distance) public virtual double FindSnappedDuration(HitObject referenceObject, float distance)