diff --git a/cocos2d/core/CCNode.js b/cocos2d/core/CCNode.js index b25b4049d5..9cc39ec28b 100644 --- a/cocos2d/core/CCNode.js +++ b/cocos2d/core/CCNode.js @@ -551,11 +551,11 @@ var Node = cc.Class({ } } - // check conflict - - if (CC_EDITOR && !_Scene.DetectConflict.beforeAddComponent(this, constructor)) { - return null; - } + //// check conflict + // + //if (CC_EDITOR && !_Scene.DetectConflict.beforeAddComponent(this, constructor)) { + // return null; + //} // diff --git a/cocos2d/core/components/CCLayout.js b/cocos2d/core/components/CCLayout.js index 2ac3f8d1db..c0d81b8aa8 100644 --- a/cocos2d/core/components/CCLayout.js +++ b/cocos2d/core/components/CCLayout.js @@ -143,6 +143,12 @@ var Layout = cc.Class({ default: Type.NONE, type: Type, notify: function() { + if (this.layoutType !== Type.NONE && this._resize === ResizeType.CONTAINER && CC_EDITOR && !cc.engine.isPlaying) { + var reLayouted = _Scene.DetectConflict.checkConflict_Layout(this); + if (reLayouted) { + return; + } + } this._doLayoutDirty(); }, animatable: false, @@ -168,8 +174,14 @@ var Layout = cc.Class({ return; } - this._doLayoutDirty(); this._resize = value; + if (this.layoutType !== Type.NONE && value === ResizeType.CONTAINER && CC_EDITOR && !cc.engine.isPlaying) { + var reLayouted = _Scene.DetectConflict.checkConflict_Layout(this); + if (reLayouted) { + return; + } + } + this._doLayoutDirty(); }, animatable: false }, @@ -197,6 +209,12 @@ var Layout = cc.Class({ default: AxisDirection.HORIZONTAL, type: AxisDirection, notify: function() { + if (this._resize === ResizeType.CONTAINER && CC_EDITOR && !cc.engine.isPlaying) { + var reLayouted = _Scene.DetectConflict.checkConflict_Layout(this); + if (reLayouted) { + return; + } + } this._doLayoutDirty(); }, animatable: false diff --git a/cocos2d/core/components/CCWidget.js b/cocos2d/core/components/CCWidget.js index 9ede45babc..34ee6f72cb 100644 --- a/cocos2d/core/components/CCWidget.js +++ b/cocos2d/core/components/CCWidget.js @@ -392,6 +392,10 @@ var Widget = cc.Class({ if (this.isStretchWidth) { // become stretch this._originalWidth = this.node.width; + // test check conflict + if (CC_EDITOR && !cc.engine.isPlaying) { + _Scene.DetectConflict.checkConflict_Widget(this); + } } } else { @@ -399,6 +403,10 @@ var Widget = cc.Class({ if (this.isStretchHeight) { // become stretch this._originalHeight = this.node.height; + // test check conflict + if (CC_EDITOR && !cc.engine.isPlaying) { + _Scene.DetectConflict.checkConflict_Widget(this); + } } }