From 24b314b51f9c5c28be61b09fa6f56558c03c8100 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Thu, 7 Jun 2018 19:00:02 +0900 Subject: [PATCH] Fix hold note masks not working --- .../Layers/Selection/Overlays/HoldNoteMask.cs | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteMask.cs b/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteMask.cs index 0b468515d3..648ec29e64 100644 --- a/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteMask.cs +++ b/osu.Game.Rulesets.Mania/Edit/Layers/Selection/Overlays/HoldNoteMask.cs @@ -18,14 +18,12 @@ namespace osu.Game.Rulesets.Mania.Edit.Layers.Selection.Overlays public HoldNoteMask(DrawableHoldNote hold) : base(hold) { - Position = hold.Position; - var holdObject = hold.HitObject; InternalChildren = new Drawable[] { - new NoteMask(hold.Head), - new NoteMask(hold.Tail), + new HoldNoteNoteMask(hold.Head), + new HoldNoteNoteMask(hold.Tail), body = new BodyPiece { AccentColour = Color4.Transparent @@ -40,5 +38,29 @@ namespace osu.Game.Rulesets.Mania.Edit.Layers.Selection.Overlays { body.BorderColour = colours.Yellow; } + + protected override void Update() + { + base.Update(); + + Size = HitObject.DrawSize; + Position = Parent.ToLocalSpace(HitObject.ScreenSpaceDrawQuad.TopLeft); + } + + private class HoldNoteNoteMask : NoteMask + { + public HoldNoteNoteMask(DrawableNote note) + : base(note) + { + Select(); + } + + protected override void Update() + { + base.Update(); + + Position = HitObject.DrawPosition; + } + } } }