mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 14:32:55 +08:00
Ensure max value in clamp is at least zero
This commit is contained in:
parent
9792ac2fbd
commit
9106e97c37
@ -662,7 +662,7 @@ namespace osu.Game.Screens.Select
|
||||
// as we can't be 100% sure on the size of individual carousel drawables,
|
||||
// always play it safe and extend bounds by one.
|
||||
firstIndex = Math.Max(0, firstIndex - 1);
|
||||
lastIndex = Math.Clamp(lastIndex + 1, firstIndex, visibleItems.Count - 1);
|
||||
lastIndex = Math.Clamp(lastIndex + 1, firstIndex, Math.Max(0, visibleItems.Count - 1));
|
||||
|
||||
return (firstIndex, lastIndex);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user