diff --git a/src/core/helpers/hidpi.js b/src/core/helpers/hidpi.js index d6a638c25ad04171f5f71e0e65866b8ef8426ed5..c3d935cfbe63662b9b76d05469819da82cd56e00 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