From ab9e66f0339a717f1d2583d15c75ee3f8b36caee Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 25 Oct 2021 22:15:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E9=83=BD=E9=87=87=E7=94=A8ma?= =?UTF-8?q?xWidth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/label/abstract.label.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/base/single/label/abstract.label.js b/src/base/single/label/abstract.label.js index 0d0d28c24..8bbfbee15 100644 --- a/src/base/single/label/abstract.label.js +++ b/src/base/single/label/abstract.label.js @@ -26,7 +26,7 @@ var o = this.options; return { type: "bi.text", - textAlign: "left", + textAlign: o.textAlign, whiteSpace: o.whiteSpace, lineHeight: o.textHeight, maxWidth: "100%", @@ -50,6 +50,7 @@ _createCenterEl: function () { var o = this.options; var json = this._createJson(); + json.textAlign = "left"; if (BI.isNumber(o.width) && o.width > 0) { if (BI.isNumber(o.textWidth) && o.textWidth > 0) { json.maxWidth = o.textWidth; @@ -250,7 +251,6 @@ "line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit }); } - json.textAlign = o.textAlign; this.text = BI.createWidget(BI.extend(json, { element: this, hgap: o.hgap, @@ -309,7 +309,6 @@ "line-height": (o.height - (o.vgap * 2)) / BI.pixRatio + BI.pixUnit }); } - json.textAlign = o.textAlign; this.text = BI.createWidget(BI.extend(json, { // 2.6 element: this, hgap: o.hgap,