1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-16 03:42:58 +08:00

Merge pull request #10537 from LeNitrous/fix-jittery-scorecounter

Fix legacy score & combo counter text overflowing outside padding
This commit is contained in:
Dan Balasescu 2020-10-19 13:30:11 +09:00 committed by GitHub
commit 1bc49103a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Testing;
using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu;
@ -43,5 +44,11 @@ namespace osu.Game.Tests.Visual.Gameplay
s.Current.Value += 300;
});
}
[Test]
public void TestVeryLargeScore()
{
AddStep("set large score", () => scoreCounters.ForEach(counter => counter.Current.Value = 1_000_000_000));
}
}
}

View File

@ -29,7 +29,9 @@ namespace osu.Game.Skinning
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
protected sealed override OsuSpriteText CreateSpriteText() => (OsuSpriteText)skin?.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText));
protected sealed override OsuSpriteText CreateSpriteText()
=> (OsuSpriteText)skin?.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText))
?.With(s => s.Anchor = s.Origin = Anchor.TopRight);
protected override void Update()
{

View File

@ -33,6 +33,8 @@ namespace osu.Game.Skinning
Margin = new MarginPadding(10);
}
protected sealed override OsuSpriteText CreateSpriteText() => (OsuSpriteText)skin.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText));
protected sealed override OsuSpriteText CreateSpriteText()
=> (OsuSpriteText)skin.GetDrawableComponent(new HUDSkinComponent(HUDSkinComponents.ScoreText))
.With(s => s.Anchor = s.Origin = Anchor.TopRight);
}
}