diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs index 8ed9cab79d..376747ee20 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/DragLayer.cs @@ -18,23 +18,22 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers /// public class DragLayer : CompositeDrawable { + private readonly Action performSelection; + /// /// Invoked when the drag selection has finished. /// public event Action DragEnd; - private readonly MaskContainer maskContainer; - private Drawable box; /// /// Creates a new . /// /// The selectable s. - public DragLayer(MaskContainer maskContainer) + public DragLayer(Action performSelection) { - this.maskContainer = maskContainer; - + this.performSelection = performSelection; RelativeSizeAxes = Axes.Both; AlwaysPresent = true; Alpha = 0; @@ -78,7 +77,7 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers box.Position = topLeft; box.Size = bottomRight - topLeft; - maskContainer.Select(dragRectangle); + performSelection?.Invoke(dragRectangle); return true; } diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs index ca8525b842..ad8e752d19 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs @@ -35,8 +35,8 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers selectionBox = composer.CreateSelectionBox(maskContainer); - var dragLayer = new DragLayer(maskContainer); dragLayer.DragEnd += () => selectionBox.UpdateVisibility(); + var dragLayer = new DragLayer(maskContainer.Select); InternalChildren = new Drawable[] {