workgroupengineering
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with
14 additions and
14 deletions
-
src/Avalonia.Base/Animation/Animators/BoolAnimator.cs
-
src/Avalonia.Base/Animation/Animators/ByteAnimator.cs
-
src/Avalonia.Base/Animation/Animators/DecimalAnimator.cs
-
src/Avalonia.Base/Animation/Animators/DoubleAnimator.cs
-
src/Avalonia.Base/Animation/Animators/FloatAnimator.cs
-
src/Avalonia.Base/Animation/Animators/Int16Animator.cs
-
src/Avalonia.Base/Animation/Animators/Int32Animator.cs
-
src/Avalonia.Base/Animation/Animators/Int64Animator.cs
-
src/Avalonia.Base/Animation/Animators/TransformAnimator.cs
-
src/Avalonia.Base/Animation/Animators/UInt16Animator.cs
-
src/Avalonia.Base/Animation/Animators/UInt32Animator.cs
-
src/Avalonia.Base/Animation/Animators/UInt64Animator.cs
-
src/Avalonia.Base/Animation/TransitionBase.cs
|
|
|
@ -5,7 +5,7 @@ |
|
|
|
/// </summary>
|
|
|
|
internal class BoolAnimator : Animator<bool> |
|
|
|
{ |
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override bool Interpolate(double progress, bool oldValue, bool newValue) |
|
|
|
{ |
|
|
|
if(progress >= 1d) |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ namespace Avalonia.Animation.Animators |
|
|
|
{ |
|
|
|
const double maxVal = (double)byte.MaxValue; |
|
|
|
|
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override byte Interpolate(double progress, byte oldValue, byte newValue) |
|
|
|
{ |
|
|
|
var normOV = oldValue / maxVal; |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ |
|
|
|
/// </summary>
|
|
|
|
internal class DecimalAnimator : Animator<decimal> |
|
|
|
{ |
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override decimal Interpolate(double progress, decimal oldValue, decimal newValue) |
|
|
|
{ |
|
|
|
return ((newValue - oldValue) * (decimal)progress) + oldValue; |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ |
|
|
|
/// </summary>
|
|
|
|
internal class DoubleAnimator : Animator<double> |
|
|
|
{ |
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override double Interpolate(double progress, double oldValue, double newValue) |
|
|
|
{ |
|
|
|
return ((newValue - oldValue) * progress) + oldValue; |
|
|
|
|
|
|
|
@ -5,7 +5,7 @@ |
|
|
|
/// </summary>
|
|
|
|
internal class FloatAnimator : Animator<float> |
|
|
|
{ |
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override float Interpolate(double progress, float oldValue, float newValue) |
|
|
|
{ |
|
|
|
return (float)(((newValue - oldValue) * progress) + oldValue); |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ namespace Avalonia.Animation.Animators |
|
|
|
{ |
|
|
|
const double maxVal = (double)Int16.MaxValue; |
|
|
|
|
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override Int16 Interpolate(double progress, Int16 oldValue, Int16 newValue) |
|
|
|
{ |
|
|
|
var normOV = oldValue / maxVal; |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ namespace Avalonia.Animation.Animators |
|
|
|
{ |
|
|
|
const double maxVal = (double)Int32.MaxValue; |
|
|
|
|
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override Int32 Interpolate(double progress, Int32 oldValue, Int32 newValue) |
|
|
|
{ |
|
|
|
var normOV = oldValue / maxVal; |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ namespace Avalonia.Animation.Animators |
|
|
|
{ |
|
|
|
const double maxVal = (double)Int64.MaxValue; |
|
|
|
|
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override Int64 Interpolate(double progress, Int64 oldValue, Int64 newValue) |
|
|
|
{ |
|
|
|
var normOV = oldValue / maxVal; |
|
|
|
|
|
|
|
@ -92,7 +92,7 @@ namespace Avalonia.Animation.Animators |
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override double Interpolate(double p, double o, double n) => 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ namespace Avalonia.Animation.Animators |
|
|
|
{ |
|
|
|
const double maxVal = (double)UInt16.MaxValue; |
|
|
|
|
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override UInt16 Interpolate(double progress, UInt16 oldValue, UInt16 newValue) |
|
|
|
{ |
|
|
|
var normOV = oldValue / maxVal; |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ namespace Avalonia.Animation.Animators |
|
|
|
{ |
|
|
|
const double maxVal = (double)UInt32.MaxValue; |
|
|
|
|
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override UInt32 Interpolate(double progress, UInt32 oldValue, UInt32 newValue) |
|
|
|
{ |
|
|
|
var normOV = oldValue / maxVal; |
|
|
|
|
|
|
|
@ -9,7 +9,7 @@ namespace Avalonia.Animation.Animators |
|
|
|
{ |
|
|
|
const double maxVal = (double)UInt64.MaxValue; |
|
|
|
|
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
public override UInt64 Interpolate(double progress, UInt64 oldValue, UInt64 newValue) |
|
|
|
{ |
|
|
|
var normOV = oldValue / maxVal; |
|
|
|
|
|
|
|
@ -77,7 +77,7 @@ namespace Avalonia.Animation |
|
|
|
set { SetAndRaise(EasingProperty, ref _easing, value); } |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
[DisallowNull] |
|
|
|
public AvaloniaProperty? Property |
|
|
|
{ |
|
|
|
@ -91,7 +91,7 @@ namespace Avalonia.Animation |
|
|
|
set => Property = value; |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdocs/>
|
|
|
|
/// <inheritdoc/>
|
|
|
|
IDisposable ITransition.Apply(Animatable control, IClock clock, object? oldValue, object? newValue) |
|
|
|
=> Apply(control, clock, oldValue, newValue); |
|
|
|
|
|
|
|
|