1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

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.
This commit is contained in:
smoogipoo 2018-03-19 18:00:11 +09:00
parent cbe2de33c5
commit 8d4c9eda48

View File

@ -51,7 +51,11 @@ namespace osu.Game.Screens.Edit.Screens.Compose.Layers
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()
{