Browse Source

布局大一统

master
guy 4 years ago
parent
commit
dd8e8e56a2
  1. 3
      src/base/single/label/abstract.label.js

3
src/base/single/label/abstract.label.js

@ -211,6 +211,7 @@
var o = this.options; var o = this.options;
var adaptLayout = "bi.vertical_adapt"; var adaptLayout = "bi.vertical_adapt";
var json = this._createJson(); var json = this._createJson();
json.textAlign = "left";
if (BI.isNumber(o.width) && o.width > 0) { if (BI.isNumber(o.width) && o.width > 0) {
if (BI.isNumber(o.textWidth) && o.textWidth > 0) { if (BI.isNumber(o.textWidth) && o.textWidth > 0) {
json.width = o.textWidth; json.width = o.textWidth;
@ -251,6 +252,7 @@
return; return;
} }
if (BI.isNumber(o.height) && o.height > 0) { // 2.3 if (BI.isNumber(o.height) && o.height > 0) { // 2.3
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, { this.text = BI.createWidget(BI.extend(json, {
element: this, element: this,
hgap: o.hgap, hgap: o.hgap,
@ -314,6 +316,7 @@
"line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit "line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit
}); });
} }
json.textAlign = o.textAlign;
this.text = BI.createWidget(BI.extend(json, { // 2.6 this.text = BI.createWidget(BI.extend(json, { // 2.6
element: this, element: this,
hgap: o.hgap, hgap: o.hgap,

Loading…
Cancel
Save