From f4fd263671f8fab8a4d1b943dbac586fd71d3f3d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 13 Jul 2017 16:28:31 +0900 Subject: [PATCH] Fix settings not offsetting scroll operations by fixed header content --- osu.Game/Graphics/Containers/SectionsContainer.cs | 2 ++ osu.Game/Overlays/SettingsOverlay.cs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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() }