Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix song select potentially displaying BPM range with equal min/max values #18345

Merged
merged 4 commits into from May 21, 2022

Conversation

frenzibyte
Copy link
Member

@frenzibyte frenzibyte commented May 20, 2022

The wedge determines whether to display a range or a singular value using Precision.AlmostEquals(..., 0.001f), which isn't correct given that the BPMs are rounded and can be equal in integral form but different in decimals.

Therefore the BPMs are rounded first, then casted to integers and compared to each other.

While at it, I've also included a change that avoids cases like 120 BPM formed by 120 - 120.4 turn into 180-181 BPM when DT is enabled, instead of staying singular at 180 BPM.

However, that... involved rounding twice to achieve expectations, first rounding the decimal BPM value to integral (e.g. 120.6 -> 121), then rounding the rounded BPM with the decimal rate applied to it (e.g. 121 * 1.5 -> 181.5 -> 182).

Can consider reverting if the rate should be applied to the decimal BPM directly and let cases like the one mentioned above (120 -> 180-181) to remain as-is.

@peppy peppy merged commit 98e5bbd into ppy:master May 21, 2022
@frenzibyte frenzibyte deleted the bpm-display-rounding-fix branch May 21, 2022 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Beatmap's BPM range is shown in the carousel even if its values are rounded to the same integer
2 participants