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

Merge pull request #5876 from peppy/fix-drag-outside-overlay

Fix drags outside of overlay container bounds not hiding overlay
This commit is contained in:
Dan Balasescu 2019-08-29 12:48:17 +09:00 committed by GitHub
commit 9bb96115bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -62,15 +62,23 @@ namespace osu.Game.Graphics.Containers
protected override bool OnClick(ClickEvent e)
{
if (!base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
{
Hide();
return true;
}
closeIfOutside(e);
return base.OnClick(e);
}
protected override bool OnDragEnd(DragEndEvent e)
{
closeIfOutside(e);
return base.OnDragEnd(e);
}
private void closeIfOutside(MouseEvent e)
{
if (!base.ReceivePositionalInputAt(e.ScreenSpaceMousePosition))
Hide();
}
public virtual bool OnPressed(GlobalAction action)
{
switch (action)