From 8e4ba5490f5fe1f02493e6053b0180dde8b6e39d Mon Sep 17 00:00:00 2001 From: unamed <1319491857@qq.com> Date: Sun, 6 Feb 2022 13:16:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BC=A9=E7=95=A5=E5=9B=BEbu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- libs/maps.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/maps.js b/libs/maps.js index cdd40507..a5565f61 100644 --- a/libs/maps.js +++ b/libs/maps.js @@ -40,9 +40,11 @@ maps.prototype._resetFloorImages = function () { maps.prototype._setHDCanvasSize = function (ctx, width, height) { ctx.setTransform(1, 0, 0, 1, 0, 0); - if (width != null) ctx.canvas.width = width * core.domStyle.ratio; - if (height != null) ctx.canvas.height = height * core.domStyle.ratio; - ctx.scale(core.domStyle.ratio, core.domStyle.ratio); + var ratio = core.domStyle.ratio; + if (ctx === core.bigmap.tempCanvas) ratio = core.domStyle.scale; + if (width != null) ctx.canvas.width = width * ratio; + if (height != null) ctx.canvas.height = height * ratio; + ctx.scale(ratio, ratio); ctx.canvas.setAttribute('isHD', 1); }