From 4aaa48739cee611d1f9458eec67c1c93623d7e46 Mon Sep 17 00:00:00 2001 From: Rustam Sayfutdinov Date: Wed, 24 Jun 2020 20:36:58 +0500 Subject: [PATCH] Fix skip ISolidColorBrush when animation --- .../Animation/Animators/SolidColorBrushAnimator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs b/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs index 8776d3a7b7..8f0b710f63 100644 --- a/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs +++ b/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs @@ -29,13 +29,13 @@ namespace Avalonia.Animation.Animators { foreach (var keyframe in this) { - if (keyframe.Value as ISolidColorBrush == null) + if (!(keyframe.Value is ISolidColorBrush)) return Disposable.Empty; // Preprocess keyframe values to Color if the xaml parser converts them to ISCB. - if (keyframe.Value.GetType() == typeof(ImmutableSolidColorBrush)) + if (keyframe.Value is ISolidColorBrush colorBrush) { - keyframe.Value = ((ImmutableSolidColorBrush)keyframe.Value).Color; + keyframe.Value = colorBrush.Color; } }