mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
26 lines
732 B
C#
26 lines
732 B
C#
namespace Dalamud.Interface.Animation.EasingFunctions;
|
|
|
|
/// <summary>
|
|
/// Class providing an "InOutCirc" easing animation.
|
|
/// </summary>
|
|
public class InOutCirc : Easing
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="InOutCirc"/> class.
|
|
/// </summary>
|
|
/// <param name="duration">The duration of the animation.</param>
|
|
public InOutCirc(TimeSpan duration)
|
|
: base(duration)
|
|
{
|
|
// ignored
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public override void Update()
|
|
{
|
|
var p = this.Progress;
|
|
this.Value = p < 0.5
|
|
? (1 - Math.Sqrt(1 - Math.Pow(2 * p, 2))) / 2
|
|
: (Math.Sqrt(1 - Math.Pow((-2 * p) + 2, 2)) + 1) / 2;
|
|
}
|
|
}
|