Fix drags outside of overlay container bounds not hiding overlay

This commit is contained in:
Dean Herbert 2019-08-29 12:07:58 +09:00
parent 67151afa9a
commit 03a4acaf4c
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)