Fix score panel being incorrectly vertically aligned on screen resize

This commit is contained in:
Dean Herbert 2020-09-24 12:49:32 +09:00
parent fb9d2cb05c
commit 5612357574
2 changed files with 5 additions and 3 deletions

View File

@ -273,10 +273,10 @@ private void onStatisticsStateChanged(ValueChangedEvent<Visibility> state)
detachedPanelContainer.Add(expandedPanel);
// Move into its original location in the local container first, then to the final location.
var origLocation = detachedPanelContainer.ToLocalSpace(screenSpacePos);
expandedPanel.MoveTo(origLocation)
var origLocation = detachedPanelContainer.ToLocalSpace(screenSpacePos).X;
expandedPanel.MoveToX(origLocation)
.Then()
.MoveTo(new Vector2(StatisticsPanel.SIDE_PADDING, origLocation.Y), 150, Easing.OutQuint);
.MoveToX(StatisticsPanel.SIDE_PADDING, 150, Easing.OutQuint);
// Hide contracted panels.
foreach (var contracted in ScorePanelList.GetScorePanels().Where(p => p.State == PanelState.Contracted))

View File

@ -99,6 +99,8 @@ public ScorePanel AddScore(ScoreInfo score)
{
var panel = new ScorePanel(score)
{
Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft,
PostExpandAction = () => PostExpandAction?.Invoke()
}.With(p =>
{