1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 06:03:08 +08:00

Fix incorrect timing distribution display due to lack of rounding

This commit is contained in:
Dean Herbert 2020-10-09 04:41:45 +09:00
parent 8dddd8aff5
commit a5b2c4195e
2 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,12 @@ namespace osu.Game.Tests.Visual.Ranking
createTest(CreateDistributedHitEvents());
}
[Test]
public void TestAroundCentre()
{
createTest(Enumerable.Range(-100, 100).Select(i => new HitEvent(i / 50f, HitResult.Perfect, new HitCircle(), new HitCircle(), null)).ToList());
}
[Test]
public void TestZeroTimeOffset()
{

View File

@ -66,7 +66,7 @@ namespace osu.Game.Screens.Ranking.Statistics
foreach (var e in hitEvents)
{
int binOffset = (int)(e.TimeOffset / binSize);
int binOffset = (int)Math.Round(e.TimeOffset / binSize);
bins[timing_distribution_centre_bin_index + binOffset]++;
}