Skip to content

Commit

Permalink
Merge pull request #104 from hyperoslo/fix/swipe-animations
Browse files Browse the repository at this point in the history
Fix gesture animations
  • Loading branch information
vadymmarkov authored Mar 3, 2018
2 parents 91b13f2 + 35b361b commit d4a57a2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Source/Animations/DissolveAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Animations/PopAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Animations/TransitionAnimation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d4a57a2

Please sign in to comment.