mirror of
https://github.com/ppy/osu
synced 2024-12-15 11:25:29 +00:00
Merge pull request #6022 from peppy/fix-drag-out-chat
Fix dragging from inside to outside an overlay incorrectly hiding
This commit is contained in:
commit
ae083ccc1f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user