From 05eee3fdb583cbfc0938902df2edcc0aa5320397 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Thu, 11 Feb 2021 10:47:04 -0500 Subject: [PATCH] Center more accurately --- commands/edit-image/rotate.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/edit-image/rotate.js b/commands/edit-image/rotate.js index 4792e7e7..5a1f20ff 100644 --- a/commands/edit-image/rotate.js +++ b/commands/edit-image/rotate.js @@ -42,7 +42,7 @@ module.exports = class RotateCommand extends Command { ctx.translate(canvas.width / 2, canvas.height / 2); ctx.rotate(degrees * (Math.PI / 180)); ctx.translate(-(canvas.width / 2), -(canvas.height / 2)); - ctx.drawImage(data, canvas.width / 2, canvas.height / 2); + ctx.drawImage(data, (canvas.width / 2) - (data.width / 2), (canvas.height / 2) - (data.height / 2)); ctx.translate(canvas.width / 2, canvas.height / 2); ctx.rotate(-degrees * (Math.PI / 180)); const attachment = canvas.toBuffer();