feat: 优化选区功能,修复部分bug

This commit is contained in:
bighuixiang
2025-07-10 01:01:46 +08:00
parent 943b49c1d7
commit 7359fe2f9a
11 changed files with 1667 additions and 126 deletions

View File

@@ -407,8 +407,8 @@ export class CanvasManager {
// 居中所有画布元素,包括背景层和其他元素
this.centerAllObjects();
// 重新渲染画布使变更生效
this.canvas.renderAll();
// // 重新渲染画布使变更生效
// this.canvas.renderAll();
}
/**
@@ -510,7 +510,7 @@ export class CanvasManager {
}
// 重新渲染画布
this.canvas.renderAll();
// this.canvas.renderAll();
}
/**
@@ -958,6 +958,9 @@ export class CanvasManager {
// 解析JSON字符串
try {
const parsedJson = JSON.parse(json);
this.canvasWidth.value = parsedJson.canvasWidth || this.width;
this.canvasHeight.value = parsedJson.canvasHeight || this.height;
this.canvasColor.value = parsedJson.canvasColor || this.backgroundColor;
return new Promise(async (resolve, reject) => {
const tempLayers = JSON.parse(parsedJson?.layers) || [];
@@ -974,6 +977,7 @@ export class CanvasManager {
}
this.layers.value = tempLayers;
debugger;
// this.canvasWidth.value = parsedJson.canvasWidth || this.width;
// this.canvasHeight.value = parsedJson.canvasHeight || this.height;