Skip to content

Commit 43e2785

Browse files
committed
Tween compatible instant easing fix
1 parent 22039df commit 43e2785

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

cocos2d-ui/CCBReader/CCAnimationManager.m

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ - (CCBSequence*)sequenceFromSequenceId:(int)seqId {
170170

171171
- (CCActionInterval*)actionFromKeyframe0:(CCBKeyframe*)kf0 andKeyframe1:(CCBKeyframe*)kf1 propertyName:(NSString*)name node:(CCNode*)node {
172172
float duration = kf1.time - kf0.time;
173-
174-
if(kf0.easingType==kCCBKeyframeEasingInstant) {
173+
174+
if(kf0 && kf0.easingType==kCCBKeyframeEasingInstant) {
175175
duration = 0;
176176
}
177177

@@ -515,13 +515,13 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
515515
}
516516
}
517517
}
518-
518+
519519
}
520520

521521

522522
}
523523

524-
_paused = NO;
524+
_paused = NO;
525525
}
526526

527527
- (void)runAnimationsForSequenceNamed:(NSString*)name tweenDuration:(float)tweenDuration {
@@ -856,8 +856,8 @@ - (CCActionSequence*)createActionForNode:(CCNode*)node sequenceProperty:(CCBSequ
856856
// Instant
857857
if(startKF.easingType==kCCBKeyframeEasingInstant) {
858858
[actions addObject:[CCActionDelay actionWithDuration:endKF.time-startKF.time]];
859-
}
860-
859+
}
860+
861861
// Apply Easing
862862
action = [self easeAction:action easingType:startKF.easingType easingOpt:startKF.easingOpt];
863863
[actions addObject:action];

0 commit comments

Comments
 (0)