🐛 fix: Typography ellipsis miss calculate decimal (#20689)

This commit is contained in:
zouxiaomingya 2020-01-06 16:26:54 +08:00 committed by 二货机器人
parent 70c49cd367
commit 3630569424

View File

@ -73,10 +73,11 @@ export default (
const originStyle = window.getComputedStyle(originEle);
const originCSS = styleToString(originStyle);
const lineHeight = pxToNumber(originStyle.lineHeight);
const maxHeight =
const maxHeight = Math.round(
lineHeight * (rows + 1) +
pxToNumber(originStyle.paddingTop) +
pxToNumber(originStyle.paddingBottom);
pxToNumber(originStyle.paddingTop) +
pxToNumber(originStyle.paddingBottom),
);
// Set shadow
ellipsisContainer.setAttribute('style', originCSS);