mirror of
https://github.com/ppy/osu.git
synced 2024-11-06 06:57:39 +08:00
DragLayer -> DragBox
This commit is contained in:
parent
5eecdffa5d
commit
faab744cbd
@ -29,7 +29,7 @@ namespace osu.Game.Tests.Visual
|
||||
public override IReadOnlyList<Type> RequiredTypes => new[]
|
||||
{
|
||||
typeof(MaskSelection),
|
||||
typeof(DragLayer),
|
||||
typeof(DragBox),
|
||||
typeof(HitObjectComposer),
|
||||
typeof(OsuHitObjectComposer),
|
||||
typeof(HitObjectMaskLayer),
|
||||
|
@ -8,15 +8,14 @@ using osu.Framework.Graphics.Containers;
|
||||
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 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
||||
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;
|
||||
|
@ -37,15 +37,15 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
|
||||
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user