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
1 changed files with 13 additions and 5 deletions

View File

@ -62,15 +62,23 @@ private void load(AudioManager audio)
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)