Browse Source

Cleanup.

pull/6029/head
Dariusz Komosinski 5 years ago
parent
commit
9b337d10de
  1. 10
      src/Avalonia.Visuals/Animation/Transitions/BrushTransition.cs

10
src/Avalonia.Visuals/Animation/Transitions/BrushTransition.cs

@ -22,9 +22,6 @@ namespace Avalonia.Animation
if (oldSolidColorBrush != null && newSolidColorBrush != null) if (oldSolidColorBrush != null && newSolidColorBrush != null)
{ {
EnsureImmutable(ref oldSolidColorBrush);
EnsureImmutable(ref newSolidColorBrush);
return new AnimatorTransitionObservable<ISolidColorBrush, ISolidColorBrushAnimator>( return new AnimatorTransitionObservable<ISolidColorBrush, ISolidColorBrushAnimator>(
s_animator, progress, Easing, oldSolidColorBrush, newSolidColorBrush); s_animator, progress, Easing, oldSolidColorBrush, newSolidColorBrush);
} }
@ -32,11 +29,6 @@ namespace Avalonia.Animation
return new IncompatibleTransitionObservable(progress, Easing, oldValue, newValue); return new IncompatibleTransitionObservable(progress, Easing, oldValue, newValue);
} }
private static void EnsureImmutable(ref ISolidColorBrush brush)
{
brush = (ISolidColorBrush)brush.ToImmutable();
}
private static ISolidColorBrush? TryGetSolidColorBrush(IBrush? brush) private static ISolidColorBrush? TryGetSolidColorBrush(IBrush? brush)
{ {
if (brush is null) if (brush is null)
@ -54,7 +46,7 @@ namespace Avalonia.Animation
public IncompatibleTransitionObservable(IObservable<double> progress, Easing easing, IBrush? from, IBrush? to) : base(progress, easing) public IncompatibleTransitionObservable(IObservable<double> progress, Easing easing, IBrush? from, IBrush? to) : base(progress, easing)
{ {
_from = @from; _from = from;
_to = to; _to = to;
} }

Loading…
Cancel
Save