1
0
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:
Bartłomiej Dach
2025-05-30 13:21:37 +02:00
Unverified
parent a3db764008
commit b6fa9c9dca
+13 -8
View File
@@ -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);