mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 04:02:59 +08:00
Clamp index to valid bounds
This commit is contained in:
parent
2e3dc6fc46
commit
833c0b223e
@ -189,7 +189,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
||||
|
||||
public void HideBar() => bar.FadeOut(fade_duration);
|
||||
|
||||
private int calculateIndex(float mouseXPosition) => (int)MathF.Round(mouseXPosition / DrawWidth * (DefaultValueCount - 1));
|
||||
private int calculateIndex(float mouseXPosition) => (int)Math.Clamp(MathF.Round(mouseXPosition / DrawWidth * (DefaultValueCount - 1)), 0, DefaultValueCount - 1);
|
||||
|
||||
private Vector2 calculateBallPosition(int index)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user