Browse Source

Merge condition

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

9
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<bool> 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;

Loading…
Cancel
Save