1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 19:22:54 +08:00

use Precision.AlmostEquals for bounds check

This commit is contained in:
Walavouchey 2023-02-08 23:59:19 +01:00
parent 0531c010eb
commit ee40444fd3

View File

@ -276,7 +276,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
foreach (double p in notchPercentages)
{
if (targetAccuracy > p - NOTCH_WIDTH_PERCENTAGE / 2 && targetAccuracy < p + NOTCH_WIDTH_PERCENTAGE / 2)
if (Precision.AlmostEquals(p, targetAccuracy, NOTCH_WIDTH_PERCENTAGE / 2))
{
int tippingDirection = targetAccuracy - p >= 0 ? 1 : -1; // We "round up" here to match rank criteria
targetAccuracy = p + tippingDirection * (NOTCH_WIDTH_PERCENTAGE / 2);