From 3ec5d774df29185cb0583b1b8ee49d29afc8eae5 Mon Sep 17 00:00:00 2001 From: Huo Yaoyuan Date: Thu, 15 Jun 2017 22:42:15 +0800 Subject: [PATCH] Child control fixes. --- osu.Game/Graphics/Containers/SectionsContainer.cs | 2 ++ osu.Game/Graphics/UserInterface/OsuTabControl.cs | 2 +- osu.Game/Overlays/UserProfileOverlay.cs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/SectionsContainer.cs b/osu.Game/Graphics/Containers/SectionsContainer.cs index e11a12d2a1..63cc6f1a85 100644 --- a/osu.Game/Graphics/Containers/SectionsContainer.cs +++ b/osu.Game/Graphics/Containers/SectionsContainer.cs @@ -103,6 +103,8 @@ namespace osu.Game.Graphics.Containers { base.Add(drawable); lastKnownScroll = float.NaN; + headerHeight = float.NaN; + footerHeight = float.NaN; } private float headerHeight, footerHeight; diff --git a/osu.Game/Graphics/UserInterface/OsuTabControl.cs b/osu.Game/Graphics/UserInterface/OsuTabControl.cs index c8cf1b539f..0a1eecd293 100644 --- a/osu.Game/Graphics/UserInterface/OsuTabControl.cs +++ b/osu.Game/Graphics/UserInterface/OsuTabControl.cs @@ -22,7 +22,7 @@ namespace osu.Game.Graphics.UserInterface protected override TabItem CreateTabItem(T value) => new OsuTabItem(value); - protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || Dropdown.Contains(screenSpacePos); + protected override bool InternalContains(Vector2 screenSpacePos) => base.InternalContains(screenSpacePos) || Dropdown?.Contains(screenSpacePos) == true; private static bool isEnumType => typeof(T).IsEnum; diff --git a/osu.Game/Overlays/UserProfileOverlay.cs b/osu.Game/Overlays/UserProfileOverlay.cs index d630e11a99..8be3058166 100644 --- a/osu.Game/Overlays/UserProfileOverlay.cs +++ b/osu.Game/Overlays/UserProfileOverlay.cs @@ -135,6 +135,8 @@ namespace osu.Game.Overlays protected override TabItem CreateTabItem(ProfileSection value) => new ProfileTabItem(value); + protected override Dropdown CreateDropdown() => null; + private class ProfileTabItem : PageTabItem { public ProfileTabItem(ProfileSection value) : base(value)