mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 08:49:59 +09:00
Clamp index to valid bounds
This commit is contained in:
@ -189,7 +189,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
|
|
||||||
public void HideBar() => bar.FadeOut(fade_duration);
|
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)
|
private Vector2 calculateBallPosition(int index)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user