From 7fe2eab497e9565b266c2c96b95909435fd40485 Mon Sep 17 00:00:00 2001 From: yinkaile <501251991@qq.com> Date: Fri, 1 Jun 2018 15:35:00 +0800 Subject: [PATCH] fixed switch scene (#2791) --- cocos2d/core/CCNode.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 3d0729449c..864286dd2b 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -2932,9 +2932,7 @@ var Node = cc.Class({ } }, - onRestore: CC_EDITOR && function () { - this._onRestoreBase(); - + _restoreProperties () { /* * TODO: Refine this code after completing undo/redo 2.0. * The node will be destroyed when deleting in the editor, @@ -2947,10 +2945,18 @@ var Node = cc.Class({ this._worldMatrix = mathPools.mat4.get(); } + this._localMatDirty = this._worldMatDirty = true; + this._renderFlag |= RenderFlow.FLAG_TRANSFORM; if (this._renderComponent) { this._renderFlag |= RenderFlow.FLAG_COLOR; } + }, + + onRestore: CC_EDITOR && function () { + this._onRestoreBase(); + + this._restoreProperties(); var actionManager = cc.director.getActionManager(); if (this._activeInHierarchy) {