Fix music controller draggability

This commit is contained in:
Dean Herbert 2017-12-30 21:10:40 +09:00
parent 58b0c9d56c
commit e332683d18
2 changed files with 5 additions and 1 deletions

View File

@ -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)

View File

@ -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)