diff --git a/src/Avalonia.Visuals/Animation/Animators/PointAnimator.cs b/src/Avalonia.Visuals/Animation/Animators/PointAnimator.cs new file mode 100644 index 0000000000..a11481c924 --- /dev/null +++ b/src/Avalonia.Visuals/Animation/Animators/PointAnimator.cs @@ -0,0 +1,22 @@ +using System; +using Avalonia.Logging; +using Avalonia.Media; + +namespace Avalonia.Animation.Animators +{ + /// + /// Animator that handles properties. + /// + public class PointAnimator : Animator + { + public override Point Interpolate(double progress, Point oldValue, Point newValue) + { + var deltaX = newValue.X - oldValue.Y; + var deltaY = newValue.X - oldValue.Y; + + var nX = progress * deltaX + oldValue.X; + var nY = progress * deltaY + oldValue.Y; + return new Point(nX, nY); + } + } +} \ No newline at end of file