From 8e7d785419f20f7fd41ef366d6cb282ecf8443d3 Mon Sep 17 00:00:00 2001 From: Rustam Sayfutdinov Date: Thu, 25 Jun 2020 11:12:40 +0500 Subject: [PATCH] Merge condition --- .../Animation/Animators/SolidColorBrushAnimator.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs b/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs index 9c94823608..a8e618af27 100644 --- a/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs +++ b/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs @@ -26,16 +26,17 @@ namespace Avalonia.Animation.Animators public override IDisposable Apply(Animation animation, Animatable control, IClock clock, IObservable match, Action onComplete) { + // Preprocess keyframe values to Color if the xaml parser converts them to ISCB. foreach (var keyframe in this) { - if (!(keyframe.Value is ISolidColorBrush)) - return Disposable.Empty; - - // Preprocess keyframe values to Color if the xaml parser converts them to ISCB. if (keyframe.Value is ISolidColorBrush colorBrush) { keyframe.Value = colorBrush.Color; } + else + { + return Disposable.Empty; + } } SolidColorBrush finalTarget;