Merge pull request #2023 from peppy/fix-skip-button

Fix skip button not receiving screen-wide input
This commit is contained in:
Dan Balasescu 2018-02-06 15:09:06 +09:00 committed by GitHub
commit fdcab55c51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 8 deletions

View File

@ -32,6 +32,8 @@ public class SkipButton : OverlayContainer, IKeyBindingHandler<GlobalAction>
private FadeContainer fadeContainer;
private double displayTime;
public override bool ReceiveMouseInputAt(Vector2 screenSpacePos) => true;
public SkipButton(double startTime)
{
this.startTime = startTime;
@ -153,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();
@ -170,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)