mirror of
https://github.com/ppy/osu.git
synced 2025-03-19 04:17:27 +08:00
Merge pull request #6890 from peppy/fix-song-select-scroll
Fix song select not always scrolling to the correct location
This commit is contained in:
commit
7d21118c77
@ -452,9 +452,6 @@ namespace osu.Game.Screens.Select
|
||||
if (!itemsCache.IsValid)
|
||||
updateItems();
|
||||
|
||||
if (!scrollPositionCache.IsValid)
|
||||
updateScrollPosition();
|
||||
|
||||
// Remove all items that should no longer be on-screen
|
||||
scrollableContent.RemoveAll(p => p.Y < visibleUpperBound - p.DrawHeight || p.Y > visibleBottomBound || !p.IsPresent);
|
||||
|
||||
@ -519,6 +516,14 @@ namespace osu.Game.Screens.Select
|
||||
updateItem(p);
|
||||
}
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
{
|
||||
base.UpdateAfterChildren();
|
||||
|
||||
if (!scrollPositionCache.IsValid)
|
||||
updateScrollPosition();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
{
|
||||
base.Dispose(isDisposing);
|
||||
@ -637,8 +642,11 @@ namespace osu.Game.Screens.Select
|
||||
|
||||
private void updateScrollPosition()
|
||||
{
|
||||
if (scrollTarget != null) scroll.ScrollTo(scrollTarget.Value);
|
||||
scrollPositionCache.Validate();
|
||||
if (scrollTarget != null)
|
||||
{
|
||||
scroll.ScrollTo(scrollTarget.Value);
|
||||
scrollPositionCache.Validate();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user