Skip to content

Commit c32543b

Browse files
committed
setZOrder: in CCNode.m
setting the zOrder of the current node is redundant if parent is present and will directly interfere with if( z == child.zOrder ) check in reorderChild:z: from CCSprite, CCSpriteBatchNode and CCParticleBatchNode causing them to defer from reordering their children. this is related to issue 598. Former-commit-id: cbb643d
1 parent a39eb57 commit c32543b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cocos2d/CCNode.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,10 +593,10 @@ -(void) setScale:(float) s
593593

594594
- (void) setZOrder:(NSInteger)zOrder
595595
{
596-
[self _setZOrder:zOrder];
597-
598596
if (_parent)
599597
[_parent reorderChild:self z:zOrder];
598+
else
599+
[self _setZOrder:zOrder]; // issue #598
600600
}
601601

602602
#pragma mark CCNode Composition

0 commit comments

Comments
 (0)