Skip to content

Commit

Permalink
馃悰 fix: Typography ellipsis miss calculate decimal (#20689)
Browse files Browse the repository at this point in the history
  • Loading branch information
zouxiaomingya authored and zombieJ committed Jan 6, 2020
1 parent 70c49cd commit 3630569
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions components/typography/util.tsx
Expand Up @@ -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);
Expand Down

0 comments on commit 3630569

Please sign in to comment.