画布删除周撤回问题
This commit is contained in:
@@ -563,6 +563,12 @@ export class RemoveLayerCommand extends Command {
|
||||
allObjects.push(object);
|
||||
}
|
||||
}
|
||||
layer.fabricObjects?.forEach((fabric) => {
|
||||
const { object } = findObjectById(this.canvas, fabric.id);
|
||||
if (object && !allObjects.includes(object)) {
|
||||
allObjects.push(object);
|
||||
}
|
||||
});
|
||||
|
||||
// 递归收集子图层的对象
|
||||
if (layer.children && Array.isArray(layer.children)) {
|
||||
@@ -609,7 +615,7 @@ export class RemoveLayerCommand extends Command {
|
||||
// this.canvas.renderAll();
|
||||
// }
|
||||
await this.layerManager?.updateLayersObjectsInteractivity?.();
|
||||
// this.canvas.renderAll();
|
||||
this.canvas.renderAll();
|
||||
|
||||
console.log(
|
||||
`✅ 已移除图层: ${this.removedLayer.name} (ID: ${this.layerId}),包含 ${this.originalObjects.length} 个对象`
|
||||
|
||||
Reference in New Issue
Block a user