From 8d4c9eda489fb5791a2a4b931f7850a57d134108 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 19 Mar 2018 18:00:11 +0900 Subject: [PATCH] Fix attempting to add selection boxes with no selection E.g. because DrawableSpinner doesn't (currently) create an overlay, SelectionBox was being constructed with 0 hitobjects and then calculating a non-finite size for itself. --- .../Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs b/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs index 63b5538ad7..46b09e2c23 100644 --- a/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs +++ b/osu.Game/Screens/Edit/Screens/Compose/Layers/HitObjectMaskLayer.cs @@ -51,7 +51,11 @@ public void RemoveOverlay(DrawableHitObject hitObject) private SelectionBox currentSelectionBox; - public void AddSelectionOverlay() => AddInternal(currentSelectionBox = composer.CreateSelectionOverlay(overlayContainer)); + public void AddSelectionOverlay() + { + if (overlayContainer.Count > 0) + AddInternal(currentSelectionBox = composer.CreateSelectionOverlay(overlayContainer)); + } public void RemoveSelectionOverlay() {