From 35b361b6bc6e1ac11826d0d2451646a79c742f65 Mon Sep 17 00:00:00 2001 From: Vadym Markov Date: Sat, 3 Mar 2018 17:22:22 +0100 Subject: [PATCH] Fix gesture animations --- Source/Animations/DissolveAnimation.swift | 2 +- Source/Animations/PopAnimation.swift | 2 +- Source/Animations/TransitionAnimation.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Animations/DissolveAnimation.swift b/Source/Animations/DissolveAnimation.swift index 74e0c5c..79db155 100644 --- a/Source/Animations/DissolveAnimation.swift +++ b/Source/Animations/DissolveAnimation.swift @@ -67,7 +67,7 @@ extension DissolveAnimation { if view.layer.animationKeys() == nil { if view.superview != nil { let ratio = offsetRatio > 0.0 ? offsetRatio : (1.0 + offsetRatio) - view.alpha = min(0.0, max(1.0, ratio)) + view.alpha = max(0.0, min(1.0, ratio)) } } } diff --git a/Source/Animations/PopAnimation.swift b/Source/Animations/PopAnimation.swift index 672d6b2..2baa956 100644 --- a/Source/Animations/PopAnimation.swift +++ b/Source/Animations/PopAnimation.swift @@ -75,7 +75,7 @@ extension PopAnimation { if view.layer.animationKeys() == nil { if view.superview != nil { let ratio = offsetRatio > 0.0 ? offsetRatio : (1.0 + offsetRatio) - view.alpha = min(0.0, max(1.0, ratio)) + view.alpha = max(0.0, min(1.0, ratio)) } } } diff --git a/Source/Animations/TransitionAnimation.swift b/Source/Animations/TransitionAnimation.swift index df3159b..6511be1 100644 --- a/Source/Animations/TransitionAnimation.swift +++ b/Source/Animations/TransitionAnimation.swift @@ -90,7 +90,7 @@ extension TransitionAnimation { let startY = position.yInFrame(superview.bounds) let dy = destination.yInFrame(superview.bounds) - startY - let ratio = min(0.0, max(1.0, offsetRatio > 0.0 ? offsetRatio : (1.0 + offsetRatio))) + let ratio = max(0.0, min(1.0, offsetRatio > 0.0 ? offsetRatio : (1.0 + offsetRatio))) let offsetX = dx * ratio let offsetY = dy * ratio