mirror of
https://github.com/ppy/osu.git
synced 2026-05-30 04:39:54 +08:00
Delay scroll to after children update
Without it the layout height set does not take effect for the scroll to correctly execute.
This commit is contained in:
@@ -706,14 +706,6 @@ namespace osu.Game.Graphics.Carousel
|
||||
selectionValid.Validate();
|
||||
}
|
||||
|
||||
if (!scrollToSelection.IsValid)
|
||||
{
|
||||
if (currentKeyboardSelection.YPosition != null)
|
||||
Scroll.ScrollTo(currentKeyboardSelection.YPosition.Value - visibleHalfHeight + BleedTop);
|
||||
|
||||
scrollToSelection.Validate();
|
||||
}
|
||||
|
||||
var range = getDisplayRange();
|
||||
|
||||
if (range != displayedRange)
|
||||
@@ -751,6 +743,19 @@ namespace osu.Game.Graphics.Carousel
|
||||
FilterAsync();
|
||||
}
|
||||
|
||||
protected override void UpdateAfterChildren()
|
||||
{
|
||||
base.UpdateAfterChildren();
|
||||
|
||||
if (!scrollToSelection.IsValid)
|
||||
{
|
||||
if (currentKeyboardSelection.YPosition != null)
|
||||
Scroll.ScrollTo(currentKeyboardSelection.YPosition.Value - visibleHalfHeight + BleedTop);
|
||||
|
||||
scrollToSelection.Validate();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual float GetPanelXOffset(Drawable panel)
|
||||
{
|
||||
Vector2 posInScroll = Scroll.ToLocalSpace(panel.ScreenSpaceDrawQuad.Centre);
|
||||
|
||||
Reference in New Issue
Block a user