From 8df4a59cbe9c133860a2197f4896c8122c9cf638 Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sat, 8 May 2021 21:15:01 +0800 Subject: [PATCH] dont use "not" c# preview feature --- .../Animation/Animators/SolidColorBrushAnimator.cs | 2 +- src/Avalonia.Visuals/ApiCompatBaseline.txt | 4 +++- src/Avalonia.Visuals/Media/SolidColorBrush.cs | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs b/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs index 80eb13d2c4..3ae9b3be5f 100644 --- a/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs +++ b/src/Avalonia.Visuals/Animation/Animators/SolidColorBrushAnimator.cs @@ -12,7 +12,7 @@ namespace Avalonia.Animation.Animators { public override IBrush Interpolate(double progress, IBrush oldValue, IBrush newValue) { - if (oldValue is not ISolidColorBrush oldValS || newValue is not ISolidColorBrush newValS) + if (!(oldValue is ISolidColorBrush oldValS) || !(newValue is ISolidColorBrush newValS)) return Brushes.Transparent; return new ImmutableSolidColorBrush(ColorAnimator.InterpolateCore(progress, oldValS.Color, newValS.Color)); diff --git a/src/Avalonia.Visuals/ApiCompatBaseline.txt b/src/Avalonia.Visuals/ApiCompatBaseline.txt index 35ba8f2b19..69a0ea30fa 100644 --- a/src/Avalonia.Visuals/ApiCompatBaseline.txt +++ b/src/Avalonia.Visuals/ApiCompatBaseline.txt @@ -1,4 +1,6 @@ Compat issues with assembly Avalonia.Visuals: +CannotRemoveBaseTypeOrInterface : Type 'Avalonia.Animation.Animators.SolidColorBrushAnimator' does not inherit from base type 'Avalonia.Animation.Animators.Animator' in the implementation but it does in the contract. +MembersMustExist : Member 'public Avalonia.Media.SolidColorBrush Avalonia.Animation.Animators.SolidColorBrushAnimator.Interpolate(System.Double, Avalonia.Media.SolidColorBrush, Avalonia.Media.SolidColorBrush)' does not exist in the implementation but it does exist in the contract. MembersMustExist : Member 'public void Avalonia.Media.TextFormatting.DrawableTextRun.Draw(Avalonia.Media.DrawingContext)' does not exist in the implementation but it does exist in the contract. CannotAddAbstractMembers : Member 'public void Avalonia.Media.TextFormatting.DrawableTextRun.Draw(Avalonia.Media.DrawingContext, Avalonia.Point)' is abstract in the implementation but is missing in the contract. CannotSealType : Type 'Avalonia.Media.TextFormatting.GenericTextParagraphProperties' is actually (has the sealed modifier) sealed in the implementation but not sealed in the contract. @@ -63,4 +65,4 @@ InterfacesShouldHaveSameMembers : Interface member 'public System.Boolean Avalon InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Platform.IGlyphRunImpl Avalonia.Platform.IPlatformRenderInterface.CreateGlyphRun(Avalonia.Media.GlyphRun)' is present in the implementation but not in the contract. InterfacesShouldHaveSameMembers : Interface member 'public Avalonia.Platform.IGlyphRunImpl Avalonia.Platform.IPlatformRenderInterface.CreateGlyphRun(Avalonia.Media.GlyphRun, System.Double)' is present in the contract but not in the implementation. MembersMustExist : Member 'public Avalonia.Platform.IGlyphRunImpl Avalonia.Platform.IPlatformRenderInterface.CreateGlyphRun(Avalonia.Media.GlyphRun, System.Double)' does not exist in the implementation but it does exist in the contract. -Total Issues: 64 +Total Issues: 66 diff --git a/src/Avalonia.Visuals/Media/SolidColorBrush.cs b/src/Avalonia.Visuals/Media/SolidColorBrush.cs index 8e30880489..f390489ed5 100644 --- a/src/Avalonia.Visuals/Media/SolidColorBrush.cs +++ b/src/Avalonia.Visuals/Media/SolidColorBrush.cs @@ -17,8 +17,8 @@ namespace Avalonia.Media static SolidColorBrush() { - Animation.Animation.RegisterAnimator(prop => typeof(IBrush).IsAssignableFrom(prop.PropertyType)); - AffectsRender(ColorProperty); + Animation.Animation.RegisterAnimator(prop => typeof(ISolidColorBrush).IsAssignableFrom(prop.PropertyType)); + AffectsRender(ColorProperty); } ///