mirror of
https://github.com/osukey/osukey.git
synced 2025-05-16 02:57:32 +09: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);
|
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)
|
protected override bool OnHover(HoverEvent e)
|
||||||
{
|
{
|
||||||
if (ranks?.Length > 1)
|
if (ranks?.Length > 1)
|
||||||
{
|
{
|
||||||
graph.UpdateBallPosition(e.MousePosition.X);
|
graph.UpdateBallPosition(lastHoverPosition = e.MousePosition.X);
|
||||||
graph.ShowBar();
|
graph.ShowBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,12 +121,8 @@ namespace osu.Game.Overlays.Profile.Header.Components
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnHoverLost(HoverLostEvent e)
|
protected override void OnHoverLost(HoverLostEvent e)
|
||||||
{
|
|
||||||
if (ranks?.Length > 1)
|
|
||||||
{
|
{
|
||||||
graph.HideBar();
|
graph.HideBar();
|
||||||
}
|
|
||||||
|
|
||||||
base.OnHoverLost(e);
|
base.OnHoverLost(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user