diff --git a/osu.Game/Graphics/Containers/SectionsContainer.cs b/osu.Game/Graphics/Containers/SectionsContainer.cs index 90cfa9046a..b43f6da8d7 100644 --- a/osu.Game/Graphics/Containers/SectionsContainer.cs +++ b/osu.Game/Graphics/Containers/SectionsContainer.cs @@ -123,6 +123,8 @@ namespace osu.Game.Graphics.Containers originalSectionsMargin = sectionsContainer.Margin; } + public void ScrollTo(Drawable section) => ScrollContainer.ScrollTo(ScrollContainer.GetChildPosInContent(section) - FixedHeader.BoundingBox.Height); + private float lastKnownScroll; protected override void UpdateAfterChildren() { diff --git a/osu.Game/Overlays/SettingsOverlay.cs b/osu.Game/Overlays/SettingsOverlay.cs index fa55134c1f..82dffbb3f7 100644 --- a/osu.Game/Overlays/SettingsOverlay.cs +++ b/osu.Game/Overlays/SettingsOverlay.cs @@ -93,7 +93,7 @@ namespace osu.Game.Overlays new SidebarButton { Section = section, - Action = b => sectionsContainer.ScrollContainer.ScrollTo(b), + Action = s => sectionsContainer.ScrollTo(s), } ).ToArray() }