Merge pull request #1908 from knoxHuang/Fix_Label

Failed to refresh the size in time for fireball/issues/6263
This commit is contained in:
Wang Nan
2017-08-17 15:10:03 +08:00
committed by GitHub
+5 -5
View File
@@ -489,11 +489,6 @@ var Label = cc.Class({
__preload: function () {
this._super();
var sgSizeInitialized = this._sgNode._isUseSystemFont;
if (sgSizeInitialized) {
this._updateNodeSize();
}
// node should be resize whenever font changed, needed only on web
if (!CC_JSB) {
this._sgNode.on('load', this._updateNodeSize, this);
@@ -501,6 +496,11 @@ var Label = cc.Class({
},
onEnable: function () {
this._super();
this._updateNodeSize();
},
_createSgNode: function () {
return null;
},