diff --git a/cocos2d/base_nodes/CCNode.js b/cocos2d/base_nodes/CCNode.js index f620db75ac..d148aae0ee 100644 --- a/cocos2d/base_nodes/CCNode.js +++ b/cocos2d/base_nodes/CCNode.js @@ -1193,6 +1193,7 @@ cc.NodeWebGL = cc.Class.extend(/** @lends cc.NodeWebGL# */{ //continue moving element downwards while zOrder is smaller or when zOrder is the same but mutatedIndex is smaller while (j >= 0 && ( tempItem._zOrder < tempChild._zOrder || ( tempItem._zOrder == tempChild._zOrder && tempItem._orderOfArrival < tempChild._orderOfArrival ))) { + tempChild = _children[j]; _children[j + 1] = tempChild; j = j - 1; }