mirror of
https://github.com/ppy/osu
synced 2024-12-13 10:28:17 +00:00
Fix music controller draggability
This commit is contained in:
parent
58b0c9d56c
commit
e332683d18
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user