From b0b7b7c8cb5ff06d8b9f20109ca70d2839fc3cda Mon Sep 17 00:00:00 2001 From: Michael Welsh Date: Thu, 17 Aug 2017 17:37:15 -0400 Subject: [PATCH] Rename _isPlayingForward to _isSpeedNegative to be more clear what it's checking --- lottie-ios/Classes/Private/LOTAnimationView.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lottie-ios/Classes/Private/LOTAnimationView.m b/lottie-ios/Classes/Private/LOTAnimationView.m index ea1375b3fa..8aab53ffba 100644 --- a/lottie-ios/Classes/Private/LOTAnimationView.m +++ b/lottie-ios/Classes/Private/LOTAnimationView.m @@ -220,7 +220,7 @@ static NSString * const kCompContainerAnimationKey = @"play"; return @(((_sceneModel.endFrame.floatValue - _sceneModel.startFrame.floatValue) * progress) + _sceneModel.startFrame.floatValue); } -- (BOOL)_isPlayingForwards { +- (BOOL)_isSpeedNegative { // If the animation speed is negative, then we're moving backwards. return _animationSpeed >= 0; } @@ -302,7 +302,7 @@ static NSString * const kCompContainerAnimationKey = @"play"; NSNumber *currentFrame = [self _frameForProgress:_animationProgress]; currentFrame = @(MAX(MIN(currentFrame.floatValue, toEndFrame.floatValue), fromStartFrame.floatValue)); - BOOL playingForward = [self _isPlayingForwards]; + BOOL playingForward = [self _isSpeedNegative]; if (currentFrame.floatValue == toEndFrame.floatValue && playingForward) { currentFrame = fromStartFrame; } else if (currentFrame.floatValue == fromStartFrame.floatValue && !playingForward) { @@ -613,7 +613,7 @@ static NSString * const kCompContainerAnimationKey = @"play"; if (complete) { // Set the final frame based on the animation to/from values. If playing forward, use the // toValue otherwise we want to end on the fromValue. - frame = [self _isPlayingForwards] ? (NSNumber *)playAnimation.toValue : (NSNumber *)playAnimation.fromValue; + frame = [self _isSpeedNegative] ? (NSNumber *)playAnimation.toValue : (NSNumber *)playAnimation.fromValue; } [self _removeCurrentAnimationIfNecessary]; [self setProgressWithFrame:frame callCompletionIfNecessary:NO];