mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #2361 from fusijie/fixed_label_asb_bug
fixed label assembler bug
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user