From 854d52ed3253b45bfaa557b2df5fb14f9db0b6e3 Mon Sep 17 00:00:00 2001 From: youxia <243802688@qq.com> Date: Thu, 11 Jan 2024 18:26:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=8B=E8=BD=AC?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/web/src/components/modals/ImageCropper.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/web/src/components/modals/ImageCropper.tsx b/client/web/src/components/modals/ImageCropper.tsx index e66b66c3..e5fa1b53 100644 --- a/client/web/src/components/modals/ImageCropper.tsx +++ b/client/web/src/components/modals/ImageCropper.tsx @@ -97,9 +97,9 @@ function getCroppedImg( canvas.height = scale * crop.height; // translate canvas context to a central location on image to allow rotating around the center. - ctx.translate(canvas.width / 2, canvas.width / 2); + ctx.translate(canvas.width / 2, canvas.height / 2); ctx.rotate(getRadianAngle(rotation)); - ctx.translate(-canvas.width / 2, -canvas.width / 2); + ctx.translate(-canvas.width / 2, -canvas.height / 2); // draw rotated image and store data. ctx.drawImage(