2020-10-01 15:34:34 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
using System;
|
|
|
|
using osu.Framework.Input.Events;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Edit.Compose.Components
|
|
|
|
{
|
2021-04-24 12:44:33 +08:00
|
|
|
public abstract class SelectionBoxDragHandle : SelectionBoxControl
|
2020-10-01 15:34:34 +08:00
|
|
|
{
|
|
|
|
public Action<DragEvent> HandleDrag { get; set; }
|
|
|
|
|
|
|
|
protected override bool OnDragStart(DragStartEvent e)
|
|
|
|
{
|
2021-04-24 12:44:33 +08:00
|
|
|
OnOperationStarted();
|
2020-10-01 15:34:34 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void OnDrag(DragEvent e)
|
|
|
|
{
|
|
|
|
HandleDrag?.Invoke(e);
|
|
|
|
base.OnDrag(e);
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void OnDragEnd(DragEndEvent e)
|
|
|
|
{
|
2021-04-24 12:44:33 +08:00
|
|
|
OnOperationEnded();
|
2020-10-01 15:34:34 +08:00
|
|
|
|
|
|
|
UpdateHoverState();
|
|
|
|
base.OnDragEnd(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|