1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-24 23:42:01 +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
Unverified
parent d7c30f9b42
commit 1548c0dc25
@@ -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);
}