Browse Source

Fix skip ISolidColorBrush when animation

pull/4165/head
Rustam Sayfutdinov 6 years ago
parent
commit
4aaa48739c
  1. 6
      src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs

6
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;
}
}

Loading…
Cancel
Save