Browse Source

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

pull/1461/head
Jumar Macato 8 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>
/// Get the nearest pair of cue-time ordered keyframes
/// according to the given time parameter.

6
src/Avalonia.Animation/Timing.cs

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

Loading…
Cancel
Save