Skip to content

Commit a2811ad

Browse files
committed
Merge pull request #753 from NickyWeber/bugfix/sb#465_cclayoutbox_spritebuilder
Ordering of nodes in a CCLayout depends on children's z-order which is n...
2 parents cde60c7 + fd844e6 commit a2811ad

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cocos2d/CCLayout.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525

2626
#import "CCLayout.h"
27+
#import "CCNode_Private.h"
2728

2829
@implementation CCLayout
2930

@@ -62,6 +63,7 @@ - (void) visit
6263
- (void) addChild:(CCNode *)node z:(NSInteger)z name:(NSString*)name
6364
{
6465
[super addChild:node z:z name:name];
66+
[self sortAllChildren];
6567
[self layout];
6668
}
6769

0 commit comments

Comments
 (0)