1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 05:42:56 +08:00

Merge pull request #6905 from peppy/carousel-less-scroll-motion

Reduce carousel scroll motion on initial display
This commit is contained in:
Dan Balasescu 2019-11-22 12:39:31 +09:00 committed by GitHub
commit 821a26682e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -640,10 +640,19 @@ namespace osu.Game.Screens.Select
itemsCache.Validate();
}
private bool firstScroll = true;
private void updateScrollPosition()
{
if (scrollTarget != null)
{
if (firstScroll)
{
// reduce movement when first displaying the carousel.
scroll.ScrollTo(scrollTarget.Value - 200, false);
firstScroll = false;
}
scroll.ScrollTo(scrollTarget.Value);
scrollPositionCache.Validate();
}