From 363056942492bf7cd8f1e8b181d14d66cc1fef18 Mon Sep 17 00:00:00 2001 From: zouxiaomingya <41714119+zouxiaomingya@users.noreply.github.com> Date: Mon, 6 Jan 2020 16:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Typography=20ellipsis=20m?= =?UTF-8?q?iss=20calculate=20decimal=20(#20689)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/typography/util.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/typography/util.tsx b/components/typography/util.tsx index fd0ff07d1a..7a7d3b8fb2 100644 --- a/components/typography/util.tsx +++ b/components/typography/util.tsx @@ -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);