From 578e1331aabb8f79e1c837bd736aa6d477e4946f Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Fri, 18 May 2018 11:06:36 +0800 Subject: [PATCH] Nit fixes part 2 --- src/Avalonia.Animation/KeyFramePair`1.cs | 2 -- .../KeyFramesStateMachine`1.cs | 35 +++++++++---------- src/Avalonia.Animation/KeyFrames`1.cs | 3 -- src/Avalonia.Animation/Transition`1.cs | 5 +-- .../Utils/BounceEaseUtils.cs | 3 +- src/Avalonia.Styling/Styling/Style.cs | 2 -- src/Avalonia.Visuals/Media/Color.cs | 5 ++- 7 files changed, 20 insertions(+), 35 deletions(-) diff --git a/src/Avalonia.Animation/KeyFramePair`1.cs b/src/Avalonia.Animation/KeyFramePair`1.cs index e7a061c32c..656950ab12 100644 --- a/src/Avalonia.Animation/KeyFramePair`1.cs +++ b/src/Avalonia.Animation/KeyFramePair`1.cs @@ -17,7 +17,6 @@ namespace Avalonia.Animation /// public struct KeyFramePair { - /// /// Initializes this /// @@ -38,6 +37,5 @@ namespace Avalonia.Animation /// Second object. /// public KeyValuePair SecondKeyFrame { get; private set; } - } } \ No newline at end of file diff --git a/src/Avalonia.Animation/KeyFramesStateMachine`1.cs b/src/Avalonia.Animation/KeyFramesStateMachine`1.cs index 66971c534c..1ac652cc63 100644 --- a/src/Avalonia.Animation/KeyFramesStateMachine`1.cs +++ b/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 _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 Interpolator) @@ -108,7 +109,6 @@ namespace Avalonia.Animation private void InternalStep(PlayState _playState, Func 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 observer) @@ -264,7 +262,6 @@ namespace Avalonia.Animation { _unsubscribe = true; _currentState = KeyFramesStates.Disposed; - } - + } } } \ No newline at end of file diff --git a/src/Avalonia.Animation/KeyFrames`1.cs b/src/Avalonia.Animation/KeyFrames`1.cs index 633d4f6fff..d8fd2464fd 100644 --- a/src/Avalonia.Animation/KeyFrames`1.cs +++ b/src/Avalonia.Animation/KeyFrames`1.cs @@ -16,7 +16,6 @@ namespace Avalonia.Animation /// public abstract class KeyFrames : AvaloniaList, IKeyFrames { - /// /// List of type-converted keyframes. /// @@ -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); diff --git a/src/Avalonia.Animation/Transition`1.cs b/src/Avalonia.Animation/Transition`1.cs index ec8d184a1c..5db3082deb 100644 --- a/src/Avalonia.Animation/Transition`1.cs +++ b/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); } - } - - -} +} \ No newline at end of file diff --git a/src/Avalonia.Animation/Utils/BounceEaseUtils.cs b/src/Avalonia.Animation/Utils/BounceEaseUtils.cs index cfb9c432ae..71b4ec4d94 100644 --- a/src/Avalonia.Animation/Utils/BounceEaseUtils.cs +++ b/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; } - } - + } } } diff --git a/src/Avalonia.Styling/Styling/Style.cs b/src/Avalonia.Styling/Styling/Style.cs index 8a59a451a2..88ff695ba2 100644 --- a/src/Avalonia.Styling/Styling/Style.cs +++ b/src/Avalonia.Styling/Styling/Style.cs @@ -115,7 +115,6 @@ namespace Avalonia.Styling foreach (var animation in Animations) { - IObservable 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) diff --git a/src/Avalonia.Visuals/Media/Color.cs b/src/Avalonia.Visuals/Media/Color.cs index df6ed2eb96..1ee5da1324 100644 --- a/src/Avalonia.Visuals/Media/Color.cs +++ b/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) ); } - + /// /// Parses a color string. /// @@ -141,4 +140,4 @@ namespace Avalonia.Media return ((uint)A << 24) | ((uint)R << 16) | ((uint)G << 8) | (uint)B; } } -} +} \ No newline at end of file