From 29f96381b4c6a1273d18c40587327dc4d807581f Mon Sep 17 00:00:00 2001 From: zsmj1994 Date: Wed, 10 Mar 2021 21:49:42 +0800 Subject: [PATCH] =?UTF-8?q?DEC-17536=20fix:=20=E4=BF=AE=E5=A4=8Dheight,max?= =?UTF-8?q?-width,line-hight=E7=AD=89props=E4=BC=A0=E5=85=A5=E7=99=BE?= =?UTF-8?q?=E5=88=86=E6=AF=94=E7=9A=84=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/text.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/base/single/text.js b/src/base/single/text.js index c79a73aef..f7925d5fe 100644 --- a/src/base/single/text.js +++ b/src/base/single/text.js @@ -44,14 +44,14 @@ "padding-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit }); } - if (BI.isNumber(o.height)) { - this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit}); + if (BI.isWidthOrHeight(o.height)) { + this.element.css({ lineHeight: BI.isNumber(o.height) ? (o.height / BI.pixRatio + BI.pixUnit) : o.height }); } - if (BI.isNumber(o.lineHeight)) { - this.element.css({lineHeight: o.lineHeight / BI.pixRatio + BI.pixUnit}); + if (BI.isWidthOrHeight(o.lineHeight)) { + this.element.css({ lineHeight: BI.isNumber(o.lineHeight) ? (o.lineHeight / BI.pixRatio + BI.pixUnit) : o.lineHeight }); } if (BI.isWidthOrHeight(o.maxWidth)) { - this.element.css({maxWidth: o.maxWidth / BI.pixRatio + BI.pixUnit}); + this.element.css({ maxWidth: BI.isNumber(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth }); } this.element.css({ textAlign: o.textAlign,