Browse Source

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

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

* commit '29f96381b4c6a1273d18c40587327dc4d807581f':
  DEC-17536 fix: 修复height,max-width,line-hight等props传入百分比的场景
es6
parent
commit
aeb3e428a2
  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 "padding-bottom": (o.vgap + o.bgap) / BI.pixRatio + BI.pixUnit
}); });
} }
if (BI.isNumber(o.height)) { if (BI.isWidthOrHeight(o.height)) {
this.element.css({lineHeight: o.height / BI.pixRatio + BI.pixUnit}); this.element.css({ lineHeight: BI.isNumber(o.height) ? (o.height / BI.pixRatio + BI.pixUnit) : o.height });
} }
if (BI.isNumber(o.lineHeight)) { if (BI.isWidthOrHeight(o.lineHeight)) {
this.element.css({lineHeight: o.lineHeight / BI.pixRatio + BI.pixUnit}); this.element.css({ lineHeight: BI.isNumber(o.lineHeight) ? (o.lineHeight / BI.pixRatio + BI.pixUnit) : o.lineHeight });
} }
if (BI.isWidthOrHeight(o.maxWidth)) { 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({ this.element.css({
textAlign: o.textAlign, textAlign: o.textAlign,

Loading…
Cancel
Save