Fix results star rating display not being centered when no mods are present

Needed or the spacing will apply to the fill flow container, causing alignment issues.
This commit is contained in:
Joehu 2020-04-03 11:30:22 -07:00
parent 493b654011
commit 88cc552534
1 changed files with 17 additions and 10 deletions

View File

@ -30,6 +30,9 @@ public class ExpandedPanelMiddleContent : CompositeDrawable
private readonly ScoreInfo score;
private readonly List<StatisticDisplay> statisticDisplays = new List<StatisticDisplay>();
private FillFlowContainer starAndModDisplay;
private RollingCounter<long> scoreCounter;
/// <summary>
@ -119,7 +122,7 @@ private void load(Bindable<WorkingBeatmap> working)
Alpha = 0,
AlwaysPresent = true
},
new FillFlowContainer
starAndModDisplay = new FillFlowContainer
{
Anchor = Anchor.TopCentre,
Origin = Anchor.TopCentre,
@ -132,15 +135,6 @@ private void load(Bindable<WorkingBeatmap> working)
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft
},
new ModDisplay
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
DisplayUnrankedText = false,
ExpansionMode = ExpansionMode.AlwaysExpanded,
Scale = new Vector2(0.5f),
Current = { Value = score.Mods }
}
}
},
new FillFlowContainer
@ -215,6 +209,19 @@ private void load(Bindable<WorkingBeatmap> working)
}
}
};
if (score.Mods.Any())
{
starAndModDisplay.Add(new ModDisplay
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
DisplayUnrankedText = false,
ExpansionMode = ExpansionMode.AlwaysExpanded,
Scale = new Vector2(0.5f),
Current = { Value = score.Mods }
});
}
}
protected override void LoadComplete()