From e332683d185f18454a3b6e4af38dfb6399fac8d5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Sat, 30 Dec 2017 21:10:40 +0900 Subject: [PATCH] Fix music controller draggability --- osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs | 2 ++ osu.Game/Overlays/MusicController.cs | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs index a6d1414676..f67da52fc0 100644 --- a/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs +++ b/osu.Game/Graphics/Containers/OsuFocusedOverlayContainer.cs @@ -64,6 +64,8 @@ namespace osu.Game.Graphics.Containers return base.OnDragStart(state); } + protected override bool OnDrag(InputState state) => State == Visibility.Hidden; + private void onStateChanged(Visibility visibility) { switch (visibility) diff --git a/osu.Game/Overlays/MusicController.cs b/osu.Game/Overlays/MusicController.cs index b19eab47a0..93ce3329df 100644 --- a/osu.Game/Overlays/MusicController.cs +++ b/osu.Game/Overlays/MusicController.cs @@ -67,6 +67,8 @@ namespace osu.Game.Overlays protected override bool OnDrag(InputState state) { + if (base.OnDrag(state)) return true; + Trace.Assert(state.Mouse.PositionMouseDown != null, "state.Mouse.PositionMouseDown != null"); Vector2 change = state.Mouse.Position - state.Mouse.PositionMouseDown.Value; @@ -75,7 +77,7 @@ namespace osu.Game.Overlays change *= change.Length <= 0 ? 0 : (float)Math.Pow(change.Length, 0.7f) / change.Length; dragContainer.MoveTo(change); - return base.OnDrag(state); + return true; } protected override bool OnDragEnd(InputState state)