Merge pull request #2361 from fusijie/fixed_label_asb_bug

fixed label assembler bug
This commit is contained in:
pandamicro
2018-02-26 17:23:18 +08:00
committed by GitHub
2 changed files with 10 additions and 5 deletions
+2 -2
View File
@@ -60,7 +60,7 @@ cc.ActionInterval = cc.Class({
this._repeatForever = false;
this._repeatMethod = false;//Compatible with repeat class, Discard after can be deleted
this._speedMethod = false;//Compatible with repeat class, Discard after can be deleted
d !== undefined && this.initWithDuration(d);
d !== undefined && this.initWithDuration(d);
},
/*
@@ -1068,7 +1068,7 @@ cc.MoveBy = cc.Class({
this._startPosition = cc.p(0, 0);
this._previousPosition = cc.p(0, 0);
deltaPos !== undefined && this.initWithDuration(duration, deltaPos, deltaY);
deltaPos !== undefined && this.initWithDuration(duration, deltaPos, deltaY);
},
/*
@@ -32,7 +32,12 @@ const bmfontAssembler = require('./bmfont-assembler');
var labelAssembler = js.addon({
updateRenderData (comp) {
this.datas.length = 0;
if (comp.string) {
if (typeof (comp.string) === "undefined" || comp.string === null) {
comp.string = "";
}else {
comp.string = comp.string.toString();
}
if (comp.string !== "") {
let assembler;
if (comp.font instanceof cc.BitmapFont) {
assembler = bmfontAssembler;
@@ -49,9 +54,9 @@ var labelAssembler = js.addon({
let size = comp.node._contentSize;
let anchor = comp.node._anchorPoint;
renderData.updateSizeNPivot(size.width, size.height, anchor.x, anchor.y);
assembler.update(comp);
renderData.effect = comp.getEffect();
this.datas.push(renderData);
}