2019-01-24 16:43:03 +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.
|
2018-11-16 16:12:24 +08:00
|
|
|
|
|
|
|
using System.Linq;
|
|
|
|
using osu.Framework.Input.Events;
|
2018-11-26 15:08:56 +08:00
|
|
|
using osu.Game.Rulesets.Edit;
|
2018-11-16 16:12:24 +08:00
|
|
|
using osu.Game.Rulesets.Osu.Objects;
|
|
|
|
using osu.Game.Screens.Edit.Compose.Components;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Osu.Edit
|
|
|
|
{
|
2018-11-19 15:58:11 +08:00
|
|
|
public class OsuSelectionHandler : SelectionHandler
|
2018-11-16 16:12:24 +08:00
|
|
|
{
|
2018-11-26 15:08:56 +08:00
|
|
|
public override void HandleDrag(SelectionBlueprint blueprint, DragEvent dragEvent)
|
2018-11-16 16:12:24 +08:00
|
|
|
{
|
|
|
|
foreach (var h in SelectedHitObjects.OfType<OsuHitObject>())
|
|
|
|
{
|
|
|
|
if (h is Spinner)
|
|
|
|
{
|
|
|
|
// Spinners don't support position adjustments
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
h.Position += dragEvent.Delta;
|
|
|
|
}
|
2018-11-26 15:08:56 +08:00
|
|
|
|
|
|
|
base.HandleDrag(blueprint, dragEvent);
|
2018-11-16 16:12:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|