diff --git a/src/Avalonia.Visuals/Animation/Animators/GradientBrushAnimator.cs b/src/Avalonia.Visuals/Animation/Animators/GradientBrushAnimator.cs index 3c13752992..f2d5632995 100644 --- a/src/Avalonia.Visuals/Animation/Animators/GradientBrushAnimator.cs +++ b/src/Avalonia.Visuals/Animation/Animators/GradientBrushAnimator.cs @@ -16,8 +16,6 @@ namespace Avalonia.Animation.Animators { private static readonly RelativePointAnimator s_relativePointAnimator = new RelativePointAnimator(); private static readonly DoubleAnimator s_doubleAnimator = new DoubleAnimator(); - private static readonly TransformAnimator s_transformAnimator = new TransformAnimator(); - private static readonly MatrixAnimator _matrixAnimator = new MatrixAnimator(); public override IGradientBrush? Interpolate(double progress, IGradientBrush? oldValue, IGradientBrush? newValue) { @@ -32,7 +30,7 @@ namespace Avalonia.Animation.Animators return new ImmutableRadialGradientBrush( InterpolateStops(progress, oldValue.GradientStops, newValue.GradientStops), s_doubleAnimator.Interpolate(progress, oldValue.Opacity, newValue.Opacity), - oldValue.Transform is { } && newValue.Transform is { } ? InterpolateTransform(progress, oldValue.Transform, newValue.Transform) : null, + oldValue.Transform is { } ? new ImmutableTransform(oldValue.Transform.Value) : null, oldValue.SpreadMethod, s_relativePointAnimator.Interpolate(progress, oldRadial.Center, newRadial.Center), s_relativePointAnimator.Interpolate(progress, oldRadial.GradientOrigin, newRadial.GradientOrigin), @@ -42,7 +40,7 @@ namespace Avalonia.Animation.Animators return new ImmutableConicGradientBrush( InterpolateStops(progress, oldValue.GradientStops, newValue.GradientStops), s_doubleAnimator.Interpolate(progress, oldValue.Opacity, newValue.Opacity), - oldValue.Transform is { } && newValue.Transform is { } ? InterpolateTransform(progress, oldValue.Transform, newValue.Transform) : null, + oldValue.Transform is { } ? new ImmutableTransform(oldValue.Transform.Value) : null, oldValue.SpreadMethod, s_relativePointAnimator.Interpolate(progress, oldConic.Center, newConic.Center), s_doubleAnimator.Interpolate(progress, oldConic.Angle, newConic.Angle)); @@ -51,7 +49,7 @@ namespace Avalonia.Animation.Animators return new ImmutableLinearGradientBrush( InterpolateStops(progress, oldValue.GradientStops, newValue.GradientStops), s_doubleAnimator.Interpolate(progress, oldValue.Opacity, newValue.Opacity), - oldValue.Transform is { } && newValue.Transform is { } ? InterpolateTransform(progress, oldValue.Transform, newValue.Transform) : null, + oldValue.Transform is { } ? new ImmutableTransform(oldValue.Transform.Value) : null, oldValue.SpreadMethod, s_relativePointAnimator.Interpolate(progress, oldLinear.StartPoint, newLinear.StartPoint), s_relativePointAnimator.Interpolate(progress, oldLinear.EndPoint, newLinear.EndPoint)); @@ -91,11 +89,6 @@ namespace Avalonia.Animation.Animators return stops; } - private ImmutableTransform InterpolateTransform(double progress, ITransform oldValue, ITransform newValue) - { - return new ImmutableTransform(_matrixAnimator.Interpolate(progress, oldValue.Value, newValue.Value)); - } - internal static IGradientBrush ConvertSolidColorBrushToGradient(IGradientBrush gradientBrush, ISolidColorBrush solidColorBrush) { switch (gradientBrush) diff --git a/src/Avalonia.Visuals/Animation/Animators/MatrixAnimator.cs b/src/Avalonia.Visuals/Animation/Animators/MatrixAnimator.cs deleted file mode 100644 index d5b6267a3c..0000000000 --- a/src/Avalonia.Visuals/Animation/Animators/MatrixAnimator.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace Avalonia.Animation.Animators -{ - /// - /// Animator that handles properties. - /// - public class MatrixAnimator : Animator - { - /// - public override Matrix Interpolate(double progress, Matrix oldValue, Matrix newValue) - { - return new Matrix( - ((newValue.M11 - oldValue.M11) * progress) + oldValue.M11, - ((newValue.M12 - oldValue.M12) * progress) + oldValue.M12, - ((newValue.M21 - oldValue.M21) * progress) + oldValue.M21, - ((newValue.M22 - oldValue.M22) * progress) + oldValue.M22, - ((newValue.M31 - oldValue.M31) * progress) + oldValue.M31, - ((newValue.M32 - oldValue.M32) * progress) + oldValue.M32); - } - } -} diff --git a/src/Avalonia.Visuals/Animation/Transitions/MatrixTransition.cs b/src/Avalonia.Visuals/Animation/Transitions/MatrixTransition.cs deleted file mode 100644 index 59bf06ca26..0000000000 --- a/src/Avalonia.Visuals/Animation/Transitions/MatrixTransition.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Avalonia.Animation.Animators; - -namespace Avalonia.Animation -{ - /// - /// Transition class that handles with type. - /// - public class MatrixTransition : AnimatorDrivenTransition - { - } -} diff --git a/src/Avalonia.Visuals/Matrix.cs b/src/Avalonia.Visuals/Matrix.cs index 7a56aa6fe2..af62375b52 100644 --- a/src/Avalonia.Visuals/Matrix.cs +++ b/src/Avalonia.Visuals/Matrix.cs @@ -15,13 +15,6 @@ namespace Avalonia #endif readonly struct Matrix : IEquatable { - static Matrix() - { -#if !BUILDTASK - Animation.Animation.RegisterAnimator(prop => typeof(Matrix).IsAssignableFrom(prop.PropertyType)); -#endif - } - private readonly double _m11; private readonly double _m12; private readonly double _m21;