From 9bfec9b23335aaafc4f452e07cf207d9f4a5fb0d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 6 Feb 2018 14:30:01 +0900 Subject: [PATCH] Tidy up state change logic --- osu.Game/Screens/Play/SkipButton.cs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/osu.Game/Screens/Play/SkipButton.cs b/osu.Game/Screens/Play/SkipButton.cs index 880219cb2c..f67a9b801e 100644 --- a/osu.Game/Screens/Play/SkipButton.cs +++ b/osu.Game/Screens/Play/SkipButton.cs @@ -155,16 +155,11 @@ private class FadeContainer : Container, IStateful public Visibility State { - get - { - return state; - } + get { return state; } set { - if (state == value) - return; + bool stateChanged = value != state; - var lastState = state; state = value; scheduledHide?.Cancel(); @@ -172,7 +167,8 @@ public Visibility State switch (state) { case Visibility.Visible: - if (lastState == Visibility.Hidden) + // we may be triggered to become visible mnultiple times but we only want to transform once. + if (stateChanged) this.FadeIn(500, Easing.OutExpo); if (!IsHovered)