Skip to content

Commit dfbf0bc

Browse files
author
pandamicro
committed
Fix local z order not being set when node doesn’t have a parent issue
1 parent 92278e7 commit dfbf0bc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

cocos2d/core/base-nodes/CCNode.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ cc.Node = cc.Class.extend(/** @lends cc.Node# */{
308308
setLocalZOrder: function (localZOrder) {
309309
if (this._parent)
310310
this._parent.reorderChild(this, localZOrder);
311+
else
312+
this._localZOrder = localZOrder;
311313
cc.eventManager._setDirtyForNode(this);
312314
},
313315

0 commit comments

Comments
 (0)