Browse Source

DEC-17536 fix: 修复height,max-width,line-hight等props传入百分比的场景

es6
zsmj1994 4 years ago
parent
commit
29f96381b4
  1. 10
      src/base/single/text.js

10
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,

Loading…
Cancel
Save