mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 20:32:55 +08: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);
|
return base.OnDragStart(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override bool OnDrag(InputState state) => State == Visibility.Hidden;
|
||||||
|
|
||||||
private void onStateChanged(Visibility visibility)
|
private void onStateChanged(Visibility visibility)
|
||||||
{
|
{
|
||||||
switch (visibility)
|
switch (visibility)
|
||||||
|
@ -67,6 +67,8 @@ namespace osu.Game.Overlays
|
|||||||
|
|
||||||
protected override bool OnDrag(InputState state)
|
protected override bool OnDrag(InputState state)
|
||||||
{
|
{
|
||||||
|
if (base.OnDrag(state)) return true;
|
||||||
|
|
||||||
Trace.Assert(state.Mouse.PositionMouseDown != null, "state.Mouse.PositionMouseDown != null");
|
Trace.Assert(state.Mouse.PositionMouseDown != null, "state.Mouse.PositionMouseDown != null");
|
||||||
|
|
||||||
Vector2 change = state.Mouse.Position - state.Mouse.PositionMouseDown.Value;
|
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;
|
change *= change.Length <= 0 ? 0 : (float)Math.Pow(change.Length, 0.7f) / change.Length;
|
||||||
|
|
||||||
dragContainer.MoveTo(change);
|
dragContainer.MoveTo(change);
|
||||||
return base.OnDrag(state);
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnDragEnd(InputState state)
|
protected override bool OnDragEnd(InputState state)
|
||||||
|
Loading…
Reference in New Issue
Block a user