Skip to content

Commit 4163159

Browse files
committed
Fix for tweening # 2.
1 parent 4c776a9 commit 4163159

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

cocos2d-ui/CCBReader/CCAnimationManager.m

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,6 @@ - (CCBSequence*)sequenceFromSequenceId:(int)seqId {
171171
- (CCActionInterval*)actionFromKeyframe0:(CCBKeyframe*)kf0 andKeyframe1:(CCBKeyframe*)kf1 propertyName:(NSString*)name node:(CCNode*)node {
172172
float duration = kf1.time - kf0.time;
173173

174-
if(kf0.easingType==kCCBKeyframeEasingInstant) {
175-
duration = 0;
176-
}
177-
178174
if ([name isEqualToString:@"rotation"]) {
179175
return [CCActionRotateTo actionWithDuration:duration angle:[kf1.value floatValue] simple:YES];
180176
} else if ([name isEqualToString:@"position"]) {
@@ -360,7 +356,7 @@ - (void)runActionsForNode:(CCNode*)node sequenceProperty:(CCBSequenceProperty*)s
360356
if(numKeyframes<1) return;
361357

362358
// Action Sequence Builder
363-
NSMutableArray* actions = [NSMutableArray array];
359+
NSMutableArray* actions = [NSMutableArray array];
364360
int endFrame = startFrame+1;
365361

366362
if(endFrame==numKeyframes || endFrame<0)
@@ -515,13 +511,13 @@ - (void)runAnimationsForSequenceId:(int)seqId tweenDuration:(float) tweenDuratio
515511
}
516512
}
517513
}
518-
514+
519515
}
520516

521517

522518
}
523519

524-
_paused = NO;
520+
_paused = NO;
525521
}
526522

527523
- (void)runAnimationsForSequenceNamed:(NSString*)name tweenDuration:(float)tweenDuration {
@@ -856,8 +852,8 @@ - (CCActionSequence*)createActionForNode:(CCNode*)node sequenceProperty:(CCBSequ
856852
// Instant
857853
if(startKF.easingType==kCCBKeyframeEasingInstant) {
858854
[actions addObject:[CCActionDelay actionWithDuration:endKF.time-startKF.time]];
859-
}
860-
855+
}
856+
861857
// Apply Easing
862858
action = [self easeAction:action easingType:startKF.easingType easingOpt:startKF.easingOpt];
863859
[actions addObject:action];

0 commit comments

Comments
 (0)