From f99e79faa8b5d0ab9a4f13780efd27c9c08c46d2 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Sat, 8 Sep 2018 17:54:10 -0500 Subject: [PATCH 1/3] Fix carousel animation crash --- src/Avalonia.Visuals/Animation/PageSlide.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Avalonia.Visuals/Animation/PageSlide.cs b/src/Avalonia.Visuals/Animation/PageSlide.cs index dc2c64f1c7..d6245a39fe 100644 --- a/src/Avalonia.Visuals/Animation/PageSlide.cs +++ b/src/Avalonia.Visuals/Animation/PageSlide.cs @@ -86,7 +86,7 @@ namespace Avalonia.Animation new Setter { Property = translateProperty, - Value = 0 + Value = 0.0 } ) { @@ -130,7 +130,7 @@ namespace Avalonia.Animation new Setter { Property = translateProperty, - Value = 0 + Value = 0.0 } ) { From 5e6a6f7e03b398f6d8860bc098167df08e19e272 Mon Sep 17 00:00:00 2001 From: Jumar Macato Date: Sun, 9 Sep 2018 20:44:32 +0800 Subject: [PATCH 2/3] Add explicit double type marker on values. Flip the sign on distance to match the correct behavior. --- src/Avalonia.Visuals/Animation/CrossFade.cs | 8 ++++---- src/Avalonia.Visuals/Animation/PageSlide.cs | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/Avalonia.Visuals/Animation/CrossFade.cs b/src/Avalonia.Visuals/Animation/CrossFade.cs index 3795d66d05..d5ddf1c7f5 100644 --- a/src/Avalonia.Visuals/Animation/CrossFade.cs +++ b/src/Avalonia.Visuals/Animation/CrossFade.cs @@ -38,11 +38,11 @@ namespace Avalonia.Animation new Setter { Property = Visual.OpacityProperty, - Value = 0.0 + Value = 0d } ) { - Cue = new Cue(1.0) + Cue = new Cue(1d) } }; _fadeInAnimation = new Animation @@ -52,11 +52,11 @@ namespace Avalonia.Animation new Setter { Property = Visual.OpacityProperty, - Value = 0.0 + Value = 0d } ) { - Cue = new Cue(0.0) + Cue = new Cue(0d) } }; _fadeOutAnimation.Duration = _fadeInAnimation.Duration = duration; diff --git a/src/Avalonia.Visuals/Animation/PageSlide.cs b/src/Avalonia.Visuals/Animation/PageSlide.cs index d6245a39fe..23e52f90ac 100644 --- a/src/Avalonia.Visuals/Animation/PageSlide.cs +++ b/src/Avalonia.Visuals/Animation/PageSlide.cs @@ -86,22 +86,22 @@ namespace Avalonia.Animation new Setter { Property = translateProperty, - Value = 0.0 + Value = 0d } ) { - Cue = new Cue(0.0) + Cue = new Cue(0d) }, new KeyFrame ( new Setter { Property = translateProperty, - Value = forward ? -distance : distance + Value = forward ? distance : -distance } ) { - Cue = new Cue(1.0) + Cue = new Cue(1d) } }; animation.Duration = Duration; @@ -123,18 +123,18 @@ namespace Avalonia.Animation } ) { - Cue = new Cue(0.0) + Cue = new Cue(0d) }, new KeyFrame ( new Setter { Property = translateProperty, - Value = 0.0 + Value = 0d } ) { - Cue = new Cue(1.0) + Cue = new Cue(1d) }, }; animation.Duration = Duration; From 2be60e593ddf5e5b3f01a32fcf6fe317634fb8d9 Mon Sep 17 00:00:00 2001 From: Jeremy Koritzinsky Date: Sun, 9 Sep 2018 09:17:23 -0500 Subject: [PATCH 3/3] Fix PageSlide direction mess-up. --- src/Avalonia.Visuals/Animation/PageSlide.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Avalonia.Visuals/Animation/PageSlide.cs b/src/Avalonia.Visuals/Animation/PageSlide.cs index d6245a39fe..d03b8fce23 100644 --- a/src/Avalonia.Visuals/Animation/PageSlide.cs +++ b/src/Avalonia.Visuals/Animation/PageSlide.cs @@ -119,7 +119,7 @@ namespace Avalonia.Animation new Setter { Property = translateProperty, - Value = forward ? -distance : distance + Value = forward ? distance : -distance } ) {