From 06b1965b8c4afd347218070b10ae5e990d79a1a4 Mon Sep 17 00:00:00 2001 From: SijieWang Date: Mon, 7 May 2018 17:21:31 +0800 Subject: [PATCH 1/4] sizeProvider.visible needs to be updated --- cocos2d/core/CCNode.js | 1 + 1 file changed, 1 insertion(+) diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 6f61247562..366e8b2806 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -2529,6 +2529,7 @@ var Node = cc.Class({ } } } + sizeProvider.visible = this.active; } var sgParent = this._parent && this._parent._sgNode; From 0e854f3cc4ada815987ee60ca5f8dc48f60e897a Mon Sep 17 00:00:00 2001 From: SijieWang Date: Mon, 7 May 2018 18:01:58 +0800 Subject: [PATCH 2/4] `active` must synchronize to component --- cocos2d/core/CCNode.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 366e8b2806..2ef6fb8bca 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -2460,6 +2460,15 @@ var Node = cc.Class({ var self = this; var sgNode = self._sgNode; + // `active` must synchronize to component + for (var i=0; i Date: Mon, 7 May 2018 18:16:10 +0800 Subject: [PATCH 3/4] move code to onRestore --- cocos2d/core/CCNode.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 2ef6fb8bca..86cf9acc93 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -2460,15 +2460,6 @@ var Node = cc.Class({ var self = this; var sgNode = self._sgNode; - // `active` must synchronize to component - for (var i=0; i Date: Tue, 8 May 2018 11:50:41 +0800 Subject: [PATCH 4/4] review code --- cocos2d/core/CCNode.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index 86cf9acc93..8b638b998f 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -2505,13 +2505,13 @@ var Node = cc.Class({ _removeSgNode: SgHelper.removeSgNode, onRestore: CC_EDITOR && function () { - // `active` must synchronize to component + // update dummy sgNode of components for (var i=0; i