diff --git a/osu.Game/Graphics/Containers/SectionsContainer.cs b/osu.Game/Graphics/Containers/SectionsContainer.cs index b057cbfaca..6dadf0b0b0 100644 --- a/osu.Game/Graphics/Containers/SectionsContainer.cs +++ b/osu.Game/Graphics/Containers/SectionsContainer.cs @@ -139,16 +139,7 @@ namespace osu.Game.Graphics.Containers originalSectionsMargin = scrollContentContainer.Margin; } - public void ScrollToTop(T section) - { - float pos = scrollContainer.GetChildPosInContent(section); - float current = scrollContainer.Current; - float scrollOffset = FixedHeader?.LayoutSize.Y ?? 0; - if (section == Children.First() && current < pos - scrollOffset) return; - scrollContainer.ScrollTo(pos - scrollOffset); - } - - public void ScrollTo(Drawable section) => ScrollContainer.ScrollTo(ScrollContainer.GetChildPosInContent(section) - FixedHeader.BoundingBox.Height); + public void ScrollTo(Drawable section) => scrollContainer.ScrollTo(scrollContainer.GetChildPosInContent(section) - (FixedHeader?.BoundingBox.Height ?? 0)); private float lastKnownScroll; protected override void UpdateAfterChildren() diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index d2e9bdcb46..df339ad23e 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -137,7 +137,7 @@ namespace osu.Game.Overlays if (lastSection != s) { lastSection = s; - sectionsContainer.ScrollToTop(lastSection); + sectionsContainer.ScrollTo(lastSection); } };