From fc05148a661b59cfc631b4fdf24917a29d7408f2 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Mon, 28 Feb 2022 15:44:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=5F=5Fhidpi=5F=5F=20fillText=E3=80=81str?= =?UTF-8?q?okeText=20maxWidth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/helpers/hidpi.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/helpers/hidpi.js b/src/core/helpers/hidpi.js index d6a638c25..c3d935cfb 100644 --- a/src/core/helpers/hidpi.js +++ b/src/core/helpers/hidpi.js @@ -106,7 +106,7 @@ if (pixelRatio !== 1) { args[1] *= pixelRatio args[2] *= pixelRatio args[3] *= pixelRatio - typeof args[3] !== 'number' && (args.length = 3) + isNaN(args[3]) && (args.length = 3) // Safari 重新设置部分属性会导致其他值恢复默认,需获取原始值 var font = this.__font__ || this.font @@ -128,12 +128,12 @@ if (pixelRatio !== 1) { if (!this.__hidpi__) { return _super.apply(this, arguments) } - var args = Array.prototype.slice.call(arguments) + const args = Array.prototype.slice.call(arguments) args[1] *= pixelRatio // x args[2] *= pixelRatio // y - args[3] *= pixelRatio // y - typeof args[3] !== 'number' && (args.length = 3) + args[3] *= pixelRatio // maxWidth + isNaN(args[3]) && (args.length = 3) // Safari 重新设置部分属性会导致其他值恢复默认,需获取原始值 var font = this.__font__ || this.font -- GitLab