mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 02:32:55 +08:00
Remove incorrect double multiplication and add missing test coverage
This commit is contained in:
parent
d807d9d822
commit
29bc653d24
@ -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]
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user