mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:13:21 +08:00
Fix out of bounds issues
This commit is contained in:
parent
467bb9b96f
commit
044622a7a6
@ -662,7 +662,7 @@ namespace osu.Game.Screens.Select
|
|||||||
// as we can't be 100% sure on the size of individual carousel drawables,
|
// as we can't be 100% sure on the size of individual carousel drawables,
|
||||||
// always play it safe and extend bounds by one.
|
// always play it safe and extend bounds by one.
|
||||||
firstIndex = Math.Max(0, firstIndex - 1);
|
firstIndex = Math.Max(0, firstIndex - 1);
|
||||||
lastIndex = Math.Min(visibleItems.Count, lastIndex + 1);
|
lastIndex = Math.Clamp(lastIndex + 1, firstIndex, visibleItems.Count - 1);
|
||||||
|
|
||||||
return (firstIndex, lastIndex);
|
return (firstIndex, lastIndex);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user