mirror of https://github.com/ppy/osu
Tidy up state change logic
This commit is contained in:
parent
dd8955cd90
commit
9bfec9b233
|
@ -155,16 +155,11 @@ private class FadeContainer : Container, IStateful<Visibility>
|
|||
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue