Browse Source

Fix missed merge conflict.

pull/1885/head
Jumar Macato 8 years ago
parent
commit
12747f3175
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 6
      src/Avalonia.Animation/Animator`1.cs
  2. 7
      src/Avalonia.Animation/DisposeAnimationInstanceSubject.cs

6
src/Avalonia.Animation/Animator`1.cs

@ -41,7 +41,7 @@ namespace Avalonia.Animation
if (!_isVerifiedAndConverted) if (!_isVerifiedAndConverted)
VerifyConvertKeyFrames(); VerifyConvertKeyFrames();
var subject = new DisposeAnimationInstanceSubject<T>(this, animation, control, onComplete); var subject = new DisposeAnimationInstanceSubject<T>(this, animation, control, clock, onComplete);
return match.Subscribe(subject); return match.Subscribe(subject);
} }
@ -55,7 +55,7 @@ namespace Avalonia.Animation
/// <param name="animationTime">The time parameter, relative to the total animation time</param> /// <param name="animationTime">The time parameter, relative to the total animation time</param>
protected (double IntraKFTime, KeyFramePair<T> KFPair) GetKFPairAndIntraKFTime(double animationTime) protected (double IntraKFTime, KeyFramePair<T> KFPair) GetKFPairAndIntraKFTime(double animationTime)
{ {
AnimatorKeyFrame firstKeyframe, lastKeyframe ; AnimatorKeyFrame firstKeyframe, lastKeyframe;
int kvCount = _convertedKeyframes.Count; int kvCount = _convertedKeyframes.Count;
if (kvCount > 2) if (kvCount > 2)
{ {
@ -89,7 +89,7 @@ namespace Avalonia.Animation
var lastFrameData = (lastKeyframe.GetTypedValue<T>(), lastKeyframe.isNeutral); var lastFrameData = (lastKeyframe.GetTypedValue<T>(), lastKeyframe.isNeutral);
return (intraframeTime, new KeyFramePair<T>(firstFrameData, lastFrameData)); return (intraframeTime, new KeyFramePair<T>(firstFrameData, lastFrameData));
} }
private int FindClosestBeforeKeyFrame(double time) private int FindClosestBeforeKeyFrame(double time)
{ {
int FindClosestBeforeKeyFrame(int startIndex, int length) int FindClosestBeforeKeyFrame(int startIndex, int length)

7
src/Avalonia.Animation/DisposeAnimationInstanceSubject.cs

@ -23,15 +23,18 @@ namespace Avalonia.Animation
private Animation _animation; private Animation _animation;
private Animatable _control; private Animatable _control;
private Action _onComplete; private Action _onComplete;
private IClock _clock;
public DisposeAnimationInstanceSubject(Animator<T> animator, Animation animation, Animatable control, Action onComplete) public DisposeAnimationInstanceSubject(Animator<T> animator, Animation animation, Animatable control, IClock clock, Action onComplete)
{ {
this._animator = animator; this._animator = animator;
this._animation = animation; this._animation = animation;
this._control = control; this._control = control;
this._onComplete = onComplete; this._onComplete = onComplete;
this._clock = clock;
} }
public void Dispose() public void Dispose()
{ {
_lastInstance?.Dispose(); _lastInstance?.Dispose();
@ -53,7 +56,7 @@ namespace Avalonia.Animation
_lastInstance?.Dispose(); _lastInstance?.Dispose();
if (matchVal) if (matchVal)
{ {
_lastInstance = _animator.Run(_animation, _control, _onComplete); _lastInstance = _animator.Run(_animation, _control, _clock, _onComplete);
} }
_lastMatch = matchVal; _lastMatch = matchVal;
} }

Loading…
Cancel
Save