This commit is contained in:
李志鹏
2026-01-30 14:12:17 +08:00
parent 8588c74ffd
commit 0e0eed2566
3 changed files with 6 additions and 2 deletions

View File

@@ -1486,6 +1486,9 @@ backgroundObject.scaleY,'CanvasManager resetCanvasSizeByFixedLayer')
if (a.isBackground) return -1;
if (b.isBackground) return 1;
})
// 排除的对象id
const excludedObjects = [SpecialLayerId.PART_SELECTOR];
json.canvas.objects = objects.filter((v) => !excludedObjects.includes(v.id));
}

View File

@@ -1,6 +1,6 @@
import { fabric } from "fabric-with-all";
import { traceImageContour, imageToCanvas } from "../utils/helper";
import { OperationType } from "../utils/layerHelper";
import { OperationType, SpecialLayerId } from "../utils/layerHelper";
import { LassoCutoutCommand } from "../commands/LassoCutoutCommand";
import addIcon from "@/assets/images/canvas/add.png";
import removeIcon from "@/assets/images/canvas/remove.png";
@@ -72,7 +72,7 @@ export class PartManager {
this.activeTool = this.toolManager.activeTool;
this.rgba = { r: 0, g: 255, b: 0, a: 200 };
this.partId = "part_selector";
this.partId = SpecialLayerId.PART_SELECTOR;
this.partGroup = null; // 当前选区对象
this.partCanvas = null;// 选区画布
this.rectangleObject = null; // 矩形对象

View File

@@ -24,6 +24,7 @@ export const LayerType = {
export const SpecialLayerId = {
SPECIAL_GROUP: "group_special", // 特殊组
COLOR: "special_color", // 颜色图层
PART_SELECTOR: "part_selector", // 部件选择器图层
}