Remove 1ms offset and update tests

This commit is contained in:
Dean Herbert
2020-01-28 13:42:22 +09:00
parent 58654f28b6
commit 596a01661c
2 changed files with 17 additions and 15 deletions

View File

@ -135,7 +135,7 @@ namespace osu.Game.Screens.Edit
var beatLength = timingPoint.BeatLength / BeatDivisor;
// A 1ms offset prevents rounding errors due to minute variations in duration
return timingPoint.Time + (int)Math.Round(((time - timingPoint.Time) + 1) / beatLength) * beatLength;
return timingPoint.Time + (int)Math.Round((time - timingPoint.Time) / beatLength, MidpointRounding.AwayFromZero) * beatLength;
}
public double GetBeatLengthAtTime(double referenceTime) => ControlPointInfo.TimingPointAt(referenceTime).BeatLength / BeatDivisor;