Fix triangles song progress bar blinking during gameplay

Closes #23760.
This commit is contained in:
Bartłomiej Dach 2023-06-06 18:01:15 +02:00
parent eaf5813d1b
commit be59eb1116
No known key found for this signature in database

View File

@ -5,6 +5,7 @@ using System.Collections.Generic;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Configuration; using osu.Game.Configuration;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Localisation.HUD; using osu.Game.Localisation.HUD;
@ -101,7 +102,12 @@ namespace osu.Game.Screens.Play.HUD
protected override void Update() protected override void Update()
{ {
base.Update(); base.Update();
Height = bottom_bar_height + graph_height + handle_size.Y + info.Height - graph.Y;
// to prevent unnecessary invalidations of the song progress graph due to changes in size, apply tolerance when updating the height.
float newHeight = bottom_bar_height + graph_height + handle_size.Y + info.Height - graph.Y;
if (!Precision.AlmostEquals(Height, newHeight, 5f))
Height = newHeight;
} }
private void updateBarVisibility() private void updateBarVisibility()