public override T InterpolateValue(T baseValue, double keyFrameProgress) { if (EasingFunction != null) { keyFrameProgress = EasingFunction.Ease(keyFrameProgress); } return(animationOperations.Interpolate(baseValue, Value, keyFrameProgress)); }
public override object GetCurrentValue(object defaultOriginValue, object defaultDestinationValue, AnimationTimelineClock animationClock) { double progress = EasingFunction != null?EasingFunction.Ease(animationClock.CurrentState.Progress) : animationClock.CurrentState.Progress; double?baseValue = animationOperations.Zero; double?from; double?to; if (this.From != null) { if (this.To != null) { if (IsAdditive && isAccumulable) { baseValue = (double?)defaultOriginValue; } from = this.From; to = this.To; } else if (this.By != null) { if (IsAdditive && isAccumulable) { baseValue = (double?)defaultOriginValue; } from = this.From; to = animationOperations.Add(this.From, this.By); } else { from = this.From; to = (double?)defaultDestinationValue; } } else if (this.To != null) { from = (double?)defaultOriginValue; to = this.To; } else if (this.By != null) { if (isAccumulable) { baseValue = (double?)defaultOriginValue; } from = animationOperations.Zero; to = this.By; } else { from = (double?)defaultOriginValue; to = (double?)defaultDestinationValue; } if (IsCumulative && isAccumulable) { baseValue = animationOperations.Add(baseValue, animationOperations.Scale(animationOperations.Subtract(to, from), Math.Floor(animationClock.CurrentState.Iteration))); } return(animationOperations.Add(baseValue, animationOperations.Interpolate(from, to, progress))); }
public override T InterpolateValue(T baseValue, double keyFrameProgress) { return(animationOperations.Interpolate(baseValue, Value, keyFrameProgress)); }