mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #1908 from knoxHuang/Fix_Label
Failed to refresh the size in time for fireball/issues/6263
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user