From 06b1965b8c4afd347218070b10ae5e990d79a1a4 Mon Sep 17 00:00:00 2001 From: SijieWang Date: Mon, 7 May 2018 17:21:31 +0800 Subject: [PATCH 1/6] 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/6] `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/6] 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/6] 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 Date: Tue, 8 May 2018 15:53:11 +0800 Subject: [PATCH 5/6] fix AudioSource load error. (#2616) * fix AudioSource load error. * release spriteFrame when you set a null value. * fix audio preload error, more preload call will not create more WebAudioElement yet. --- cocos2d/audio/CCAudio.js | 3 +++ cocos2d/core/components/CCAudioSource.js | 2 +- cocos2d/core/components/CCSprite.js | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cocos2d/audio/CCAudio.js b/cocos2d/audio/CCAudio.js index d8d91aa9ef..9812dad57b 100644 --- a/cocos2d/audio/CCAudio.js +++ b/cocos2d/audio/CCAudio.js @@ -96,6 +96,9 @@ Audio.State = { this._loaded = false; return; } + + if (this._element) + return; var item = cc.loader.getItem(src); diff --git a/cocos2d/core/components/CCAudioSource.js b/cocos2d/core/components/CCAudioSource.js index c33a73bc98..0c881b8cef 100644 --- a/cocos2d/core/components/CCAudioSource.js +++ b/cocos2d/core/components/CCAudioSource.js @@ -215,7 +215,7 @@ var AudioSource = cc.Class({ if ( this.playOnLoad ) { this.play(); } - if ( this.preload ) { + else if ( this.preload ) { this.audio.src = this._clip; this.audio.preload(); } diff --git a/cocos2d/core/components/CCSprite.js b/cocos2d/core/components/CCSprite.js index 4889beb391..16901d2e48 100644 --- a/cocos2d/core/components/CCSprite.js +++ b/cocos2d/core/components/CCSprite.js @@ -564,6 +564,7 @@ var Sprite = cc.Class({ } } else { + sgNode.setSpriteFrame(null); sgNode.setVisible(false); } From 36e9616ce569827d8d9d0bec81c4a6a70396cbee Mon Sep 17 00:00:00 2001 From: Jare Guo Date: Wed, 9 May 2018 19:48:16 +0800 Subject: [PATCH 6/6] fix api doc --- cocos2d/core/components/CCEditBox.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2d/core/components/CCEditBox.js b/cocos2d/core/components/CCEditBox.js index 72a187fe95..d1216eebfd 100644 --- a/cocos2d/core/components/CCEditBox.js +++ b/cocos2d/core/components/CCEditBox.js @@ -328,7 +328,7 @@ var EditBox = cc.Class({ /** * !#en The font color of placeholder. - * !#zh 输入框最大允许输入的字符个数。 + * !#zh 输入框占位符的字体颜色。 * @property {Color} placeholderFontColor */ placeholderFontColor: {