feat: 1.固定图层缩略图(完成)

2.工具栏新增插槽(完成)
3.loadJSON的元素顺序回发生错误
This commit is contained in:
bighuixiang
2025-06-25 01:03:39 +08:00
parent e001c9dd49
commit afa3b69f71
14 changed files with 481 additions and 434 deletions

View File

@@ -33,7 +33,11 @@ export class CreateBackgroundLayerCommand extends Command {
const bgObject = this._createBackgroundObject();
// 将背景对象添加到图层中
this.backgroundLayer.fabricObject = bgObject;
this.backgroundLayer.fabricObject = bgObject.toObject([
"id",
"layerId",
"type",
]);
// 添加图层到最底部
this.layers.value.push(this.backgroundLayer);

View File

@@ -3581,7 +3581,11 @@ export class ChangeFixedImageCommand extends Command {
restoredImage.setCoords();
// 更新引用
this.targetLayer.fabricObject = restoredImage;
this.targetLayer.fabricObject = restoredImage.toObject([
"id",
"layerId",
"type",
]);
this.layerManager.updateLayerObject(
this.targetLayer.id,
restoredImage

View File

@@ -358,7 +358,7 @@ export class BatchInitializeRedGreenModeCommand extends Command {
this.canvas.add(object);
this.canvas.sendToBack(object);
backgroundLayer.fabricObject = object;
backgroundLayer.fabricObject = object.toObject(["id", "layerId", "type"]);
} else {
// 更新现有背景对象大小
object.set({