feat: 优化选区功能,修复部分bug
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user