Merge branch 'master' into fix-potential-deselection-crash

This commit is contained in:
Dan Balasescu
2021-04-16 16:27:47 +09:00
committed by GitHub
7 changed files with 56 additions and 28 deletions

View File

@ -196,7 +196,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
private void refreshTool()
{
removePlacement();
createPlacement();
ensurePlacementCreated();
}
private void updatePlacementPosition()
@ -215,15 +215,26 @@ namespace osu.Game.Screens.Edit.Compose.Components
{
base.Update();
if (Composer.CursorInPlacementArea)
createPlacement();
else if (currentPlacement?.PlacementActive == false)
removePlacement();
if (currentPlacement != null)
{
updatePlacementPosition();
switch (currentPlacement.PlacementActive)
{
case PlacementBlueprint.PlacementState.Waiting:
if (!Composer.CursorInPlacementArea)
removePlacement();
break;
case PlacementBlueprint.PlacementState.Finished:
removePlacement();
break;
}
}
if (Composer.CursorInPlacementArea)
ensurePlacementCreated();
if (currentPlacement != null)
updatePlacementPosition();
}
protected sealed override SelectionBlueprint CreateBlueprintFor(HitObject hitObject)
@ -249,7 +260,7 @@ namespace osu.Game.Screens.Edit.Compose.Components
NewCombo.Value = TernaryState.False;
}
private void createPlacement()
private void ensurePlacementCreated()
{
if (currentPlacement != null) return;

View File

@ -133,7 +133,7 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
var comboColours = skin.GetConfig<GlobalSkinColours, IReadOnlyList<Color4>>(GlobalSkinColours.ComboColours)?.Value ?? Array.Empty<Color4>();
var comboColour = combo.GetComboColour(comboColours);
if (HitObject is IHasDuration)
if (HitObject is IHasDuration duration && duration.Duration > 0)
circle.Colour = ColourInfo.GradientHorizontal(comboColour, comboColour.Lighten(0.4f));
else
circle.Colour = comboColour;