Implement drag operation for multiple path control points

This commit is contained in:
Bartłomiej Dach
2021-12-20 21:29:57 +01:00
parent a9408485cc
commit d2417beeac
3 changed files with 39 additions and 21 deletions

View File

@ -32,8 +32,8 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
{
public Action<PathControlPointPiece, MouseButtonEvent> RequestSelection;
public Action<PathControlPoint> DragStarted;
public Action<PathControlPoint, DragEvent> DragInProgress;
public Action DragStarted;
public Action<DragEvent> DragInProgress;
public Action DragEnded;
public List<PathControlPoint> PointsInSegment;
@ -185,14 +185,14 @@ namespace osu.Game.Rulesets.Osu.Edit.Blueprints.Sliders.Components
if (e.Button == MouseButton.Left)
{
DragStarted?.Invoke(ControlPoint);
DragStarted?.Invoke();
return true;
}
return false;
}
protected override void OnDrag(DragEvent e) => DragInProgress?.Invoke(ControlPoint, e);
protected override void OnDrag(DragEvent e) => DragInProgress?.Invoke(e);
protected override void OnDragEnd(DragEndEvent e) => DragEnded?.Invoke();