Browse Source

Remove the 2nd Observable.Tick and merge the transitions and animations timer.

pull/1461/head
Jumar Macato 9 years ago
parent
commit
5d1b33f41a
  1. 2
      src/Avalonia.Animation/Keyframes/KeyFrames.cs
  2. 6
      src/Avalonia.Animation/Timing.cs

2
src/Avalonia.Animation/Keyframes/KeyFrames.cs

@ -47,8 +47,6 @@ namespace Avalonia.Animation.Keyframes
}); });
} }
/// <summary> /// <summary>
/// Get the nearest pair of cue-time ordered keyframes /// Get the nearest pair of cue-time ordered keyframes
/// according to the given time parameter. /// according to the given time parameter.

6
src/Avalonia.Animation/Timing.cs

@ -33,7 +33,9 @@ namespace Avalonia.Animation
/// </summary> /// </summary>
static Timing() static Timing()
{ {
AnimationTimer = Observable.Interval(Tick, AvaloniaScheduler.Instance) var globalTimer = Observable.Interval(Tick, AvaloniaScheduler.Instance);
AnimationTimer = globalTimer
.Select(_ => .Select(_ =>
{ {
switch (_globalState) switch (_globalState)
@ -49,7 +51,7 @@ namespace Avalonia.Animation
.Publish() .Publish()
.RefCount(); .RefCount();
TransitionsTimer = Observable.Interval(Tick, AvaloniaScheduler.Instance) TransitionsTimer = globalTimer
.Select(p => _transitionsFrameCount += 1) .Select(p => _transitionsFrameCount += 1)
.Publish() .Publish()
.RefCount(); .RefCount();

Loading…
Cancel
Save