mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 01:12:42 +08:00
Temporary fix for sprite enable and canvas size provider
This commit is contained in:
@@ -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 () {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user