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 @@ public void TestConversionsWithSliderVelocity()
assertSnapDistance(base_distance * slider_velocity, referenceObject, true);
assertSnappedDistance(base_distance * slider_velocity + 10, base_distance * slider_velocity, referenceObject);
assertSnappedDuration(base_distance * slider_velocity + 10, 1000, referenceObject);
assertDistanceToDuration(base_distance * slider_velocity, 1000, referenceObject);
assertDurationToDistance(1000, base_distance * slider_velocity, referenceObject);
}
[Test]

View File

@ -273,7 +273,7 @@ public virtual float DurationToDistance(HitObject referenceObject, double durati
public virtual double DistanceToDuration(HitObject referenceObject, float distance)
{
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)