Temporary fix for sprite enable and canvas size provider

This commit is contained in:
pandamicro
2017-10-15 08:38:57 +02:00
parent 303ea7f683
commit 2c26976c07
2 changed files with 7 additions and 2 deletions
+5 -1
View File
@@ -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 () {
+2 -1
View File
@@ -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