1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-23 06:23:47 +08:00

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
committed by Dean Herbert
Unverified
parent c40887eee8
commit 719fbfd7ed
@@ -5,6 +5,7 @@ using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Utils;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Localisation.HUD;
@@ -101,7 +102,12 @@ namespace osu.Game.Screens.Play.HUD
protected override void 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()