DragLayer -> DragBox

This commit is contained in:
smoogipoo 2018-11-06 17:24:38 +09:00
parent 5eecdffa5d
commit faab744cbd
3 changed files with 10 additions and 11 deletions

View File

@ -29,7 +29,7 @@ public class TestCaseHitObjectComposer : OsuTestCase, IPlacementHandler
public override IReadOnlyList<Type> RequiredTypes => new[]
{
typeof(MaskSelection),
typeof(DragLayer),
typeof(DragBox),
typeof(HitObjectComposer),
typeof(OsuHitObjectComposer),
typeof(HitObjectMaskLayer),

View File

@ -8,15 +8,14 @@
using osu.Framework.Graphics.Primitives;
using osu.Framework.Graphics.Shapes;
using osu.Framework.Input.Events;
using osu.Game.Rulesets.Edit;
using OpenTK.Graphics;
namespace osu.Game.Screens.Edit.Screens.Compose.Layers
{
/// <summary>
/// A layer that handles and displays drag selection for a collection of <see cref="SelectionMask"/>s.
/// A box that displays the drag selection and provides selection events for users to handle.
/// </summary>
public class DragLayer : CompositeDrawable
public class DragBox : CompositeDrawable
{
private readonly Action<RectangleF> performSelection;
@ -28,10 +27,10 @@ public class DragLayer : CompositeDrawable
private Drawable box;
/// <summary>
/// Creates a new <see cref="DragLayer"/>.
/// Creates a new <see cref="DragBox"/>.
/// </summary>
/// <param name="maskContainer">The selectable <see cref="SelectionMask"/>s.</param>
public DragLayer(Action<RectangleF> performSelection)
/// <param name="performSelection">A delegate that performs drag selection.</param>
public DragBox(Action<RectangleF> performSelection)
{
this.performSelection = performSelection;

View File

@ -37,15 +37,15 @@ private void load()
maskSelection.DeselectAll = maskContainer.DeselectAll;
var dragLayer = new DragLayer(maskContainer.Select);
dragLayer.DragEnd += () => maskSelection.UpdateVisibility();
var dragBox = new DragBox(maskContainer.Select);
dragBox.DragEnd += () => maskSelection.UpdateVisibility();
InternalChildren = new[]
{
dragLayer,
dragBox,
maskSelection,
maskContainer,
dragLayer.CreateProxy()
dragBox.CreateProxy()
};
foreach (var obj in composer.HitObjects)