From 69e4c3807a1811c8af984d1f0b5ba807eee98031 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Tue, 7 Jul 2020 23:08:24 +0800 Subject: [PATCH] Fix bigmap v2 damage --- libs/control.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/control.js b/libs/control.js index 9fb2e4eb..8aa2d0f7 100644 --- a/libs/control.js +++ b/libs/control.js @@ -1217,6 +1217,7 @@ control.prototype._drawDamage_draw = function (ctx, onMap) { cacheCtx.canvas.width = ctx.canvas.width; cacheCtx.canvas.height = ctx.canvas.height; cacheCtx.clearRect(0, 0, cacheCtx.canvas.width, cacheCtx.canvas.height); + if (onMap && core.bigmap.v2) cacheCtx.translate(32, 32); core.setFont(cacheCtx, "bold 11px Arial"); core.setTextAlign(cacheCtx, 'left'); @@ -1242,8 +1243,9 @@ control.prototype._drawDamage_draw = function (ctx, onMap) { } core.fillBoldText(cacheCtx, one.text, px, py, one.color); }); + cacheCtx.translate(0, 0); - core.drawImage(ctx, cacheCtx.canvas, 0, 0); + core.drawImage(ctx, cacheCtx.canvas, onMap && core.bigmap.v2 ? -32 : 0, onMap && core.bigmap.v2 ? -32 : 0); } // ------ 录像相关 ------ //