From 2785218b7932e93e61a654388e9dea6ccdaccac9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 4 Mar 2022 14:59:53 +0900 Subject: [PATCH] Only apply animation if the bar is going to be larger than the minimum height --- .../Statistics/HitEventTimingDistributionGraph.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs b/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs index d510d995e2..d475556c84 100644 --- a/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs +++ b/osu.Game/Screens/Ranking/Statistics/HitEventTimingDistributionGraph.cs @@ -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)