This commit is contained in:
李志鹏
2025-11-11 14:28:41 +08:00
parent 5f3c4b5ac9
commit 7bc82af120
12 changed files with 30 additions and 13 deletions

View File

@@ -18,6 +18,7 @@ export class FillGroupLayerBackgroundCommand extends Command {
this.canvas = options.canvas;
this.layers = options.layers;
this.canvasManager = options.canvasManager;
this.layerManager = options.layerManager;
this.layerId = options.layerId;
this.fillColor = options.fillColor;
this.oldFill = null;
@@ -211,6 +212,7 @@ export class FillGroupLayerBackgroundCommand extends Command {
this.group.set({
id: layerObjects[0]?.id || generateId("group-"),
layerId: this.layer?.id,
layerName: this.layer?.name,
});
// this.group.setCoords();
// this.group.setObjectsCoords();
@@ -225,7 +227,7 @@ export class FillGroupLayerBackgroundCommand extends Command {
this.group.clipPath = clipPath;
}
layer.fabricObjects = [
this.group.toObject(["id", "layerId"]) || this.group,
this.group.toObject(["id", "layerId", "layerName"]) || this.group,
];
// removeCanvasObjectByObject(this.canvas, layerObjects?.[0]);
insertObjectAtZIndex(this.canvas, this.group, insertIndex, false, true);