提交 408eed0f 编写于 作者: Q qq_41923622

Thu Feb 6 17:32:00 CST 2025 inscode

上级 746482de
...@@ -136,6 +136,14 @@ export const useUpload = () => { ...@@ -136,6 +136,14 @@ export const useUpload = () => {
const canvas = canvasInstanceRef.current; const canvas = canvasInstanceRef.current;
if(canvasEl?.current&&typeof e === 'string'){ if(canvasEl?.current&&typeof e === 'string'){
let imgObj = new Image(); 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; imgObj.src = e as string;
initBackGroundImage(e as string, true, () => { initBackGroundImage(e as string, true, () => {
historyRef.current.updateCanvasState(ACTION.add); historyRef.current.updateCanvasState(ACTION.add);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册