Tween corner radius when scaling container becomes non-fullscreen

This commit is contained in:
Dean Herbert 2022-03-02 19:41:47 +09:00
parent 09a74cdfc6
commit 1916011ebf
1 changed files with 4 additions and 1 deletions

View File

@ -56,6 +56,8 @@ public bool AllowScaling
} }
} }
private const float corner_radius = 10;
/// <summary> /// <summary>
/// Create a new instance. /// Create a new instance.
/// </summary> /// </summary>
@ -69,7 +71,7 @@ public ScalingContainer(ScalingMode? targetMode = null)
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
RelativePositionAxes = Axes.Both, RelativePositionAxes = Axes.Both,
CornerRadius = 10, CornerRadius = corner_radius,
Child = content = new ScalingDrawSizePreservingFillContainer(targetMode != ScalingMode.Gameplay) Child = content = new ScalingDrawSizePreservingFillContainer(targetMode != ScalingMode.Gameplay)
}; };
} }
@ -176,6 +178,7 @@ private void updateSize()
sizableContainer.MoveTo(targetPosition, 500, Easing.OutQuart); sizableContainer.MoveTo(targetPosition, 500, Easing.OutQuart);
sizableContainer.ResizeTo(targetSize, 500, Easing.OutQuart).OnComplete(_ => { sizableContainer.Masking = requiresMasking; }); sizableContainer.ResizeTo(targetSize, 500, Easing.OutQuart).OnComplete(_ => { sizableContainer.Masking = requiresMasking; });
sizableContainer.TransformTo(nameof(CornerRadius), requiresMasking ? corner_radius : 0, 500, requiresMasking ? Easing.OutQuart : Easing.None);
} }
private class ScalingBackgroundScreen : BackgroundScreenDefault private class ScalingBackgroundScreen : BackgroundScreenDefault