mirror of
https://github.com/ppy/osu
synced 2024-12-13 18:37:04 +00:00
Ensure graph hover state is updated after data changes
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user