From ce6b828d9246ade1c79d2d7fc327b2a00dc111db Mon Sep 17 00:00:00 2001 From: zsmj Date: Wed, 23 Nov 2022 10:36:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=97=A0JIRA=20feat:=20=E5=8A=A0=E4=B8=AA?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20BI.getMinimumFontSize()=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=BD=93=E5=89=8D=E6=9C=80=E5=B0=8F=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/function.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/platform/web/function.js b/src/core/platform/web/function.js index 1c74836e2..47b6b9d39 100644 --- a/src/core/platform/web/function.js +++ b/src/core/platform/web/function.js @@ -137,5 +137,14 @@ BI._.extend(BI, { return version[1] * 1; } return 0; + }, + + getMinimumFontSize: function () { + const el = document.createElement('div'); + el.style.fontSize = "0px"; + document.body.appendChild(el); + const size = getComputedStyle(el).fontSize; + el.remove(); + return size; } }); From 997e307a9e4ccd6222c3b6b591a9510fdf6a99e0 Mon Sep 17 00:00:00 2001 From: zsmj Date: Thu, 24 Nov 2022 15:54:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=97=A0JIRA=20feat:=20=E5=8A=A0=E4=B8=AA?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20BI.getMinimumFontSize()=20=E8=8E=B7?= =?UTF-8?q?=E5=8F=96=E5=BD=93=E5=89=8D=E6=9C=80=E5=B0=8F=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/function.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/platform/web/function.js b/src/core/platform/web/function.js index 47b6b9d39..152933882 100644 --- a/src/core/platform/web/function.js +++ b/src/core/platform/web/function.js @@ -145,6 +145,6 @@ BI._.extend(BI, { document.body.appendChild(el); const size = getComputedStyle(el).fontSize; el.remove(); - return size; + return parseInt(size); } });