mirror of https://github.com/ppy/osu
Fix dragging from inside to outside an overlay incorrectly hiding
This commit is contained in:
parent
e5c3a906d7
commit
95baae5088
|
@ -62,21 +62,31 @@ private void load(AudioManager audio)
|
|||
|
||||
protected override bool OnClick(ClickEvent e)
|
||||
{
|
||||
closeIfOutside(e);
|
||||
if (!base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
|
||||
Hide();
|
||||
|
||||
return base.OnClick(e);
|
||||
}
|
||||
|
||||
protected override bool OnDragEnd(DragEndEvent e)
|
||||
{
|
||||
closeIfOutside(e);
|
||||
return base.OnDragEnd(e);
|
||||
}
|
||||
private bool closeOnDragEnd;
|
||||
|
||||
private void closeIfOutside(MouseEvent e)
|
||||
protected override bool OnDragStart(DragStartEvent e)
|
||||
{
|
||||
if (!base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
|
||||
closeOnDragEnd = true;
|
||||
|
||||
return base.OnDragStart(e);
|
||||
}
|
||||
|
||||
protected override bool OnDragEnd(DragEndEvent e)
|
||||
{
|
||||
if (closeOnDragEnd)
|
||||
{
|
||||
Hide();
|
||||
closeOnDragEnd = false;
|
||||
}
|
||||
|
||||
return base.OnDragEnd(e);
|
||||
}
|
||||
|
||||
public virtual bool OnPressed(GlobalAction action)
|
||||
|
|
Loading…
Reference in New Issue