1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-13 11:12:54 +08:00

Only apply animation if the bar is going to be larger than the minimum height

This commit is contained in:
Dean Herbert 2022-03-04 14:59:53 +09:00
parent 92cd8ee29f
commit 2785218b79

View File

@ -213,6 +213,8 @@ namespace osu.Game.Screens.Ranking.Statistics
private readonly Circle boxOriginal;
private readonly Circle boxAdjustment;
private const float minimum_height = 0.05f;
public Bar(float value, float maxValue, bool isCentre)
{
this.value = value;
@ -229,7 +231,7 @@ namespace osu.Game.Screens.Ranking.Statistics
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Colour = isCentre ? Color4.White : Color4Extensions.FromHex("#66FFCC"),
Height = 0,
Height = minimum_height,
},
boxAdjustment = new Circle
{
@ -249,7 +251,11 @@ namespace osu.Game.Screens.Ranking.Statistics
protected override void LoadComplete()
{
base.LoadComplete();
boxOriginal.ResizeHeightTo(Math.Clamp(value / maxValue, 0.05f, 1), duration, Easing.OutQuint);
float height = Math.Clamp(value / maxValue, minimum_height, 1);
if (height > minimum_height)
boxOriginal.ResizeHeightTo(height, duration, Easing.OutQuint);
}
public void UpdateOffset(float adjustment)