mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #1178 from zilongshanren/fix-label-debounce-issue
move debounce function in ctor
This commit is contained in:
@@ -149,6 +149,8 @@ var Label = cc.Class({
|
||||
ctor: function() {
|
||||
if(CC_EDITOR) {
|
||||
this._userDefinedFontSize = 40;
|
||||
this._debouncedUpdateSgNodeString = debounce(this._updateSgNodeString, 200);
|
||||
this._debouncedUpdateFontSize = debounce(this._updateSgNodeFontSize, 200);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -427,10 +429,6 @@ var Label = cc.Class({
|
||||
|
||||
__preload: function () {
|
||||
this._super();
|
||||
if (CC_EDITOR) {
|
||||
this._debouncedUpdateSgNodeString = debounce(this._updateSgNodeString, 200);
|
||||
this._debouncedUpdateFontSize = debounce(this._updateSgNodeFontSize, 200);
|
||||
}
|
||||
|
||||
var sgSizeInitialized = this._sgNode._isUseSystemFont;
|
||||
if (sgSizeInitialized) {
|
||||
|
||||
Reference in New Issue
Block a user