Skip to content

Commit

Permalink
Merge pull request airbnb#1108 from Joao360/bugfix/not-playing-negati…
Browse files Browse the repository at this point in the history
…ve-speeds

Fix animation not playing when dynamically using negative speeds
  • Loading branch information
buba447 committed Jan 27, 2020
2 parents 95c8084 + 80547cc commit 0c6bbf6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lottie-swift/src/Public/Animation/AnimationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ final public class AnimationView: LottieView {
layerAnimation.isRemovedOnCompletion = false
if timeOffset != 0 {
let currentLayerTime = viewLayer?.convertTime(CACurrentMediaTime(), from: nil) ?? 0
layerAnimation.beginTime = currentLayerTime - (timeOffset * 1 / Double(animationSpeed))
layerAnimation.beginTime = currentLayerTime - (timeOffset * 1 / Double(abs(animationSpeed)))
}
layerAnimation.delegate = animationContext.closure
animationContext.closure.animationLayer = animationlayer
Expand Down

0 comments on commit 0c6bbf6

Please sign in to comment.