1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 17:33:02 +08:00

Merge branch 'master' into volume-at-pause

This commit is contained in:
Dan Balasescu 2019-09-06 19:47:37 +09:00 committed by GitHub
commit f47f0e797c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,21 +62,31 @@ namespace osu.Game.Graphics.Containers
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)