Skip to content

Commit 448af35

Browse files
committed
Merge pull request #1057 from xingsenma/sortAllChildren
Fixed #2445 Fixed bug for sortAllChildren ,that tempChild is a changing Var
2 parents 80f564b + 8727c49 commit 448af35

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cocos2d/base_nodes/CCNode.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,7 @@ cc.NodeWebGL = cc.Class.extend(/** @lends cc.NodeWebGL# */{
11931193
//continue moving element downwards while zOrder is smaller or when zOrder is the same but mutatedIndex is smaller
11941194
while (j >= 0 && ( tempItem._zOrder < tempChild._zOrder ||
11951195
( tempItem._zOrder == tempChild._zOrder && tempItem._orderOfArrival < tempChild._orderOfArrival ))) {
1196+
tempChild = _children[j];
11961197
_children[j + 1] = tempChild;
11971198
j = j - 1;
11981199
}

0 commit comments

Comments
 (0)