mirror of https://github.com/ppy/osu
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:
parent
cbe2de33c5
commit
8d4c9eda48
|
@ -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()
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue