diff --git a/cocos2d/core/components/CCCanvas.js b/cocos2d/core/components/CCCanvas.js index 9ac8f4d198..efc6074fee 100644 --- a/cocos2d/core/components/CCCanvas.js +++ b/cocos2d/core/components/CCCanvas.js @@ -164,7 +164,9 @@ var Canvas = cc.Class({ Canvas.instance = this; if ( !this.node._sizeProvider ) { - this.node._sizeProvider = designResolutionWrapper; + // this.node._sizeProvider = designResolutionWrapper; + this.node.width = cc.visibleRect.width; + this.node.height = cc.visibleRect.height; } else if (CC_DEV) { var renderer = this.node.getComponent(cc._RendererUnderSG); @@ -246,6 +248,8 @@ var Canvas = cc.Class({ } this.node.setPosition(canvasSize.width * 0.5 + offsetX, canvasSize.height * 0.5 + offsetY); } + this.node.width = cc.visibleRect.width; + this.node.height = cc.visibleRect.height; }, onResized: function () { diff --git a/cocos2d/core/components/CCSprite.js b/cocos2d/core/components/CCSprite.js index 80c36479c6..ef0dc25570 100644 --- a/cocos2d/core/components/CCSprite.js +++ b/cocos2d/core/components/CCSprite.js @@ -476,7 +476,8 @@ var Sprite = cc.Class({ _activateModel: function () { // model cannot be activated if already exists or component not enabled - if (!this.enabledInHierarchy) { + // TODO: Should use enabledInHierarchy + if (!this.enabled) { return; } // model cannot be activated if texture not loaded yet