mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 01:47:33 +08:00
Merge pull request #10431 from peppy/fix-distribution-graph-rounding
Fix incorrect timing distribution display due to lack of rounding
This commit is contained in:
commit
a6d19cd2d6
@ -23,6 +23,12 @@ namespace osu.Game.Tests.Visual.Ranking
|
|||||||
createTest(CreateDistributedHitEvents());
|
createTest(CreateDistributedHitEvents());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestAroundCentre()
|
||||||
|
{
|
||||||
|
createTest(Enumerable.Range(-150, 300).Select(i => new HitEvent(i / 50f, HitResult.Perfect, new HitCircle(), new HitCircle(), null)).ToList());
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestZeroTimeOffset()
|
public void TestZeroTimeOffset()
|
||||||
{
|
{
|
||||||
|
@ -66,7 +66,7 @@ namespace osu.Game.Screens.Ranking.Statistics
|
|||||||
|
|
||||||
foreach (var e in hitEvents)
|
foreach (var e in hitEvents)
|
||||||
{
|
{
|
||||||
int binOffset = (int)(e.TimeOffset / binSize);
|
int binOffset = (int)Math.Round(e.TimeOffset / binSize, MidpointRounding.AwayFromZero);
|
||||||
bins[timing_distribution_centre_bin_index + binOffset]++;
|
bins[timing_distribution_centre_bin_index + binOffset]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user