From 163f79ebb840ac830b0209dec299619f9f8853ae Mon Sep 17 00:00:00 2001 From: youxia <243802688@qq.com> Date: Fri, 12 Jan 2024 09:42:49 +0800 Subject: [PATCH] fix: maxSize --- client/web/src/components/modals/ImageCropper.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/web/src/components/modals/ImageCropper.tsx b/client/web/src/components/modals/ImageCropper.tsx index e5fa1b53..d7c83df0 100644 --- a/client/web/src/components/modals/ImageCropper.tsx +++ b/client/web/src/components/modals/ImageCropper.tsx @@ -88,7 +88,7 @@ function getCroppedImg( if (!_isNil(ctx)) { // 计算最大尺寸 - const size = Math.min(crop.width, crop.height, maxSize); + const size = Math.min(Math.max(crop.width, crop.height), maxSize); // 计算缩放比例 const scale = size / Math.max(crop.width, crop.height);