Fix skin editor potentially leaving game-wide masking in the wrong state

Just going with the simplest way to solve this.

Closes https://github.com/ppy/osu/issues/14769.
This commit is contained in:
Dean Herbert 2021-09-17 13:48:19 +09:00
parent 06ff4838fb
commit 1b13b74740
1 changed files with 5 additions and 2 deletions

View File

@ -82,7 +82,7 @@ private void editorVisibilityChanged(ValueChangedEvent<Visibility> visibility)
{ {
if (visibility.NewValue == Visibility.Visible) if (visibility.NewValue == Visibility.Visible)
{ {
target.Masking = true; updateMasking();
target.AllowScaling = false; target.AllowScaling = false;
target.RelativePositionAxes = Axes.Both; target.RelativePositionAxes = Axes.Both;
@ -93,11 +93,14 @@ private void editorVisibilityChanged(ValueChangedEvent<Visibility> visibility)
{ {
target.AllowScaling = true; target.AllowScaling = true;
target.ScaleTo(1, SkinEditor.TRANSITION_DURATION, Easing.OutQuint).OnComplete(_ => target.Masking = false); target.ScaleTo(1, SkinEditor.TRANSITION_DURATION, Easing.OutQuint).OnComplete(_ => updateMasking());
target.MoveToX(0f, SkinEditor.TRANSITION_DURATION, Easing.OutQuint); target.MoveToX(0f, SkinEditor.TRANSITION_DURATION, Easing.OutQuint);
} }
} }
private void updateMasking() =>
target.Masking = skinEditor.State.Value == Visibility.Visible;
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e) public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e)
{ {
} }