Fix dragging from inside to outside an overlay incorrectly hiding

This commit is contained in:
Dean Herbert 2019-09-06 18:27:54 +09:00
parent e5c3a906d7
commit 95baae5088
1 changed files with 17 additions and 7 deletions

View File

@ -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)