1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 00:47:24 +08:00

Ensure graph hover state is updated after data changes

This commit is contained in:
Dean Herbert 2020-11-10 07:27:27 +09:00
parent d7c30f9b42
commit 1548c0dc25

View File

@ -94,13 +94,18 @@ namespace osu.Game.Overlays.Profile.Header.Components
}
graph.FadeTo(ranks.Length > 1 ? 1 : 0, fade_duration, Easing.Out);
if (IsHovered)
graph.UpdateBallPosition(lastHoverPosition);
}
private float lastHoverPosition;
protected override bool OnHover(HoverEvent e)
{
if (ranks?.Length > 1)
{
graph.UpdateBallPosition(e.MousePosition.X);
graph.UpdateBallPosition(lastHoverPosition = e.MousePosition.X);
graph.ShowBar();
}
@ -117,11 +122,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
protected override void OnHoverLost(HoverLostEvent e)
{
if (ranks?.Length > 1)
{
graph.HideBar();
}
graph.HideBar();
base.OnHoverLost(e);
}