using System;
using System.Collections.Generic;
using Artemis.Core.Models.Profile.LayerProperties;
using SkiaSharp;
namespace Artemis.Core.Models.Profile.KeyframeEngines
{
///
public class SKPointKeyframeEngine : KeyframeEngine
{
public sealed override List CompatibleTypes { get; } = new List {typeof(SKPoint)};
protected override object GetInterpolatedValue()
{
var currentKeyframe = (Keyframe) CurrentKeyframe;
var nextKeyframe = (Keyframe) NextKeyframe;
var xDiff = nextKeyframe.Value.X - currentKeyframe.Value.X;
var yDiff = nextKeyframe.Value.Y - currentKeyframe.Value.Y;
return new SKPoint(currentKeyframe.Value.X + xDiff * KeyframeProgress, currentKeyframe.Value.Y + yDiff * KeyframeProgress);
}
}
}