Merge pull request #594 from knoxHuang/v1.0

Sprite execution should not  ‘size-changed’ at run time
This commit is contained in:
Jare Guo
2016-04-13 15:45:30 +08:00
+4 -4
View File
@@ -499,7 +499,7 @@ var Sprite = cc.Class({
return this._sgNode.getInsetBottom();
},
onLoad: function () {
onLoad: CC_EDITOR && function () {
this._super();
this.node.on('size-changed', this._resized, this);
},
@@ -512,7 +512,7 @@ var Sprite = cc.Class({
}
},
onDestroy: function () {
onDestroy: CC_EDITOR && function () {
this._super();
this.node.off('size-changed', this._resized, this);
},
@@ -594,7 +594,7 @@ var Sprite = cc.Class({
_initSgNode: function () {
var sgNode = this._sgNode;
this._applySpriteFrame(null);
// should keep the size of the sg node the same as entity,
@@ -613,7 +613,7 @@ var Sprite = cc.Class({
sgNode.setBlendFunc(this._blendFunc);
},
_resized: function () {
_resized: CC_EDITOR && function () {
if (this._spriteFrame) {
var actualSize = this.node.getContentSize();
var expectedW = actualSize.width;