mirror of
https://github.com/ppy/osu.git
synced 2026-06-05 21:14:30 +08:00
Move selection box control internal events to drag handles
This commit is contained in:
@@ -22,9 +22,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
public event Action OperationStarted;
|
||||
public event Action OperationEnded;
|
||||
|
||||
internal event Action HoverGained;
|
||||
internal event Action HoverLost;
|
||||
|
||||
private Circle circle;
|
||||
|
||||
/// <summary>
|
||||
@@ -62,14 +59,11 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
UpdateHoverState();
|
||||
HoverGained?.Invoke();
|
||||
return true;
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
base.OnHoverLost(e);
|
||||
HoverLost?.Invoke();
|
||||
UpdateHoverState();
|
||||
}
|
||||
|
||||
@@ -89,7 +83,6 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
{
|
||||
HandlingMouse = false;
|
||||
UpdateHoverState();
|
||||
base.OnMouseUp(e);
|
||||
}
|
||||
|
||||
protected virtual void UpdateHoverState()
|
||||
|
||||
@@ -29,5 +29,25 @@ namespace osu.Game.Screens.Edit.Compose.Components
|
||||
UpdateHoverState();
|
||||
base.OnDragEnd(e);
|
||||
}
|
||||
|
||||
#region Internal events for SelectionBoxDragHandleContainer
|
||||
|
||||
internal event Action HoverGained;
|
||||
internal event Action HoverLost;
|
||||
|
||||
protected override bool OnHover(HoverEvent e)
|
||||
{
|
||||
bool result = base.OnHover(e);
|
||||
HoverGained?.Invoke();
|
||||
return result;
|
||||
}
|
||||
|
||||
protected override void OnHoverLost(HoverLostEvent e)
|
||||
{
|
||||
base.OnHoverLost(e);
|
||||
HoverLost?.Invoke();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user