From 408eed0fcf83d80f68d0f973935a91d716e60478 Mon Sep 17 00:00:00 2001 From: qq_41923622 Date: Thu, 6 Feb 2025 17:32:00 +0800 Subject: [PATCH] Thu Feb 6 17:32:00 CST 2025 inscode --- src/tiny-image-editor/src/components/Upload.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/tiny-image-editor/src/components/Upload.tsx b/src/tiny-image-editor/src/components/Upload.tsx index 13a6bb5..1235b04 100644 --- a/src/tiny-image-editor/src/components/Upload.tsx +++ b/src/tiny-image-editor/src/components/Upload.tsx @@ -136,6 +136,14 @@ export const useUpload = () => { const canvas = canvasInstanceRef.current; if(canvasEl?.current&&typeof e === 'string'){ let imgObj = new Image(); + + /** const newScaleFactor = Math.min(currentCanvasWidth / img.width, currentCanvasHeight / img.height); + img.set({ + left: 0, + top: 0, + scaleX: newScaleFactor, + scaleY: newScaleFactor + });**/ imgObj.src = e as string; initBackGroundImage(e as string, true, () => { historyRef.current.updateCanvasState(ACTION.add); -- GitLab