Browse Source

Nit fixes part 2

pull/1461/head
Jumar Macato 8 years ago
parent
commit
578e1331aa
  1. 2
      src/Avalonia.Animation/KeyFramePair`1.cs
  2. 35
      src/Avalonia.Animation/KeyFramesStateMachine`1.cs
  3. 3
      src/Avalonia.Animation/KeyFrames`1.cs
  4. 5
      src/Avalonia.Animation/Transition`1.cs
  5. 3
      src/Avalonia.Animation/Utils/BounceEaseUtils.cs
  6. 2
      src/Avalonia.Styling/Styling/Style.cs
  7. 5
      src/Avalonia.Visuals/Media/Color.cs

2
src/Avalonia.Animation/KeyFramePair`1.cs

@ -17,7 +17,6 @@ namespace Avalonia.Animation
/// </summary>
public struct KeyFramePair<T>
{
/// <summary>
/// Initializes this <see cref="KeyFramePair{T}"/>
/// </summary>
@ -38,6 +37,5 @@ namespace Avalonia.Animation
/// Second <see cref="KeyFrame"/> object.
/// </summary>
public KeyValuePair<double, T> SecondKeyFrame { get; private set; }
}
}

35
src/Avalonia.Animation/KeyFramesStateMachine`1.cs

@ -12,21 +12,23 @@ namespace Avalonia.Animation
object _lastInterpValue;
object _firstKFValue;
private ulong _delayTotalFrameCount,
_durationTotalFrameCount,
_delayFrameCount,
_durationFrameCount,
_repeatCount,
_currentIteration;
private bool _isLooping,
_isRepeating,
_isReversed,
_checkLoopAndRepeat,
_gotFirstKFValue;
private ulong _delayTotalFrameCount;
private ulong _durationTotalFrameCount;
private ulong _delayFrameCount;
private ulong _durationFrameCount;
private ulong _repeatCount;
private ulong _currentIteration;
private bool _isLooping;
private bool _isRepeating;
private bool _isReversed;
private bool _checkLoopAndRepeat;
private bool _gotFirstKFValue;
private FillMode _fillMode;
private PlaybackDirection _animationDirection;
private KeyFramesStates _currentState, _savedState;
private KeyFramesStates _currentState;
private KeyFramesStates _savedState;
private KeyFrames<T> _parent;
private Animation _targetAnimation;
private Animatable _targetControl;
@ -91,7 +93,6 @@ namespace Avalonia.Animation
_currentState = KeyFramesStates.DoDelay;
else
_currentState = KeyFramesStates.DoRun;
}
public void Step(PlayState _playState, Func<double, T> Interpolator)
@ -108,7 +109,6 @@ namespace Avalonia.Animation
private void InternalStep(PlayState _playState, Func<double, T> Interpolator)
{
if (!_gotFirstKFValue)
{
_firstKFValue = _parent.First().Value;
@ -158,7 +158,6 @@ namespace Avalonia.Animation
goto checkstate;
}
_delayFrameCount++;
break;
case KeyFramesStates.DoRun:
@ -251,7 +250,6 @@ namespace Avalonia.Animation
_targetObserver.OnCompleted();
break;
}
}
public IDisposable Subscribe(IObserver<object> observer)
@ -264,7 +262,6 @@ namespace Avalonia.Animation
{
_unsubscribe = true;
_currentState = KeyFramesStates.Disposed;
}
}
}
}

3
src/Avalonia.Animation/KeyFrames`1.cs

@ -16,7 +16,6 @@ namespace Avalonia.Animation
/// </summary>
public abstract class KeyFrames<T> : AvaloniaList<KeyFrame>, IKeyFrames
{
/// <summary>
/// List of type-converted keyframes.
/// </summary>
@ -120,7 +119,6 @@ namespace Avalonia.Animation
foreach (KeyFrame k in this)
{
if (k.Value == null)
{
throw new ArgumentNullException($"KeyFrame value can't be null.");
@ -140,7 +138,6 @@ namespace Avalonia.Animation
}
_convertedKeyframes.Add(_normalizedCue.CueValue, convertedValue);
}
SortKeyFrameCues(_convertedKeyframes);

5
src/Avalonia.Animation/Transition`1.cs

@ -64,8 +64,5 @@ namespace Avalonia.Animation
var transition = DoTransition(Timing.GetTransitionsTimer(control, Duration, TimeSpan.Zero), (T)oldValue, (T)newValue).Select(p => (object)p);
return control.Bind(Property, transition, Data.BindingPriority.Animation);
}
}
}
}

3
src/Avalonia.Animation/Utils/BounceEaseUtils.cs

@ -33,7 +33,6 @@ namespace Avalonia.Animation.Utils
{
return (54d / 5.0d * p * p) - (513d / 25.0d * p) + 268d / 25.0d;
}
}
}
}
}

2
src/Avalonia.Styling/Styling/Style.cs

@ -115,7 +115,6 @@ namespace Avalonia.Styling
foreach (var animation in Animations)
{
IObservable<bool> obsMatch = match.ObservableResult;
if (match.ImmediateResult == true)
@ -125,7 +124,6 @@ namespace Avalonia.Styling
var sub = animation.Apply((Animatable)control, obsMatch);
subs.Add(sub);
}
foreach (var setter in Setters)

5
src/Avalonia.Visuals/Media/Color.cs

@ -4,7 +4,6 @@
using System;
using System.Globalization;
using System.Linq;
using System.Numerics;
using System.Reflection;
namespace Avalonia.Media
@ -81,7 +80,7 @@ namespace Avalonia.Media
(byte)(value & 0xff)
);
}
/// <summary>
/// Parses a color string.
/// </summary>
@ -141,4 +140,4 @@ namespace Avalonia.Media
return ((uint)A << 24) | ((uint)R << 16) | ((uint)G << 8) | (uint)B;
}
}
}
}
Loading…
Cancel
Save