Skip to content

Commit 856277c

Browse files
committed
Tween compatible instant easing fix
1 parent 48b60fa commit 856277c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cocos2d-ui/CCBReader/CCAnimationManager.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,10 @@ - (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 && kf0.easingType==kCCBKeyframeEasingInstant) {
175+
duration = 0;
176+
}
173177

174178
if ([name isEqualToString:@"rotation"]) {
175179
return [CCActionRotateTo actionWithDuration:duration angle:[kf1.value floatValue] simple:YES];

0 commit comments

Comments
 (0)