1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 18:42:56 +08:00

Merge pull request #16000 from peppy/fix-legacy-combo-counter-anchor

Fix `LegacyComboCounter` not handling non-default anchor/origin specifications correctly
This commit is contained in:
Dan Balasescu 2021-12-08 16:00:06 +09:00 committed by GitHub
commit 9e3a1c75d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,23 +67,33 @@ namespace osu.Game.Screens.Play.HUD
Scale = new Vector2(1.2f);
InternalChild = counterContainer = new Container
{
AutoSizeAxes = Axes.Both,
AlwaysPresent = true,
Children = new[]
InternalChildren = new[]
{
popOutCount = new LegacySpriteText(LegacyFont.Combo)
{
Alpha = 0,
Margin = new MarginPadding(0.05f),
Blending = BlendingParameters.Additive,
Anchor = Anchor.BottomLeft,
Origin = Anchor.BottomLeft,
BypassAutoSizeAxes = Axes.Both,
},
counterContainer = new Container
{
AutoSizeAxes = Axes.Both,
AlwaysPresent = true,
Children = new[]
{
displayedCountSpriteText = new LegacySpriteText(LegacyFont.Combo)
{
// Initial text and AlwaysPresent allow the counter to have a size before it first displays a combo.
// This is useful for display in the skin editor.
Text = formatCount(0),
AlwaysPresent = true,
Alpha = 0,
},
}
}
};
}
@ -121,13 +131,6 @@ namespace osu.Game.Screens.Play.HUD
((IHasText)displayedCountSpriteText).Text = formatCount(Current.Value);
counterContainer.Anchor = Anchor;
counterContainer.Origin = Origin;
displayedCountSpriteText.Anchor = Anchor;
displayedCountSpriteText.Origin = Origin;
popOutCount.Anchor = Anchor;
popOutCount.Origin = Origin;
Current.BindValueChanged(combo => updateCount(combo.NewValue == 0), true);
}