Browse Source

Pull request #2247: 无JIRA任务 统一都采用maxWidth

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit '4f984c65cdb1d5d04d5434f51f99b7b5ee239560':
  统一都采用maxWidth
es6
guy 3 years ago
parent
commit
1171b5179b
  1. 5
      src/base/single/label/abstract.label.js

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

@ -26,7 +26,7 @@
var o = this.options; var o = this.options;
return { return {
type: "bi.text", type: "bi.text",
textAlign: "left", textAlign: o.textAlign,
whiteSpace: o.whiteSpace, whiteSpace: o.whiteSpace,
lineHeight: o.textHeight, lineHeight: o.textHeight,
maxWidth: "100%", maxWidth: "100%",
@ -50,6 +50,7 @@
_createCenterEl: function () { _createCenterEl: function () {
var o = this.options; var o = this.options;
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.maxWidth = o.textWidth; json.maxWidth = o.textWidth;
@ -250,7 +251,6 @@
"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, { this.text = BI.createWidget(BI.extend(json, {
element: this, element: this,
hgap: o.hgap, hgap: o.hgap,
@ -309,7 +309,6 @@
"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