feat: 添加对图层操作的支持,优化图层粘贴和变换命令,增强组图层遮罩位置更新逻辑

This commit is contained in:
bighuixiang
2025-07-16 18:08:20 +08:00
parent 5f29e488ed
commit 26581b234a
8 changed files with 409 additions and 164 deletions

View File

@@ -13,6 +13,7 @@ export class CanvasEventManager {
this.activeElementId = options.activeElementId || { value: null };
this.layerManager = options.layerManager || null;
this.layers = options.layers || null;
this.lastSelectLayerId = options.lastSelectLayerId || null; // 最后选择的图层ID
// 事件处理的内部状态 - 优化设备检测
this.deviceInfo = this._detectDeviceType();
@@ -410,6 +411,9 @@ export class CanvasEventManager {
finalState: TransformCommand.captureTransformState(activeObj),
objectType: activeObj.type,
name: `变换 ${activeObj.type || "对象"}`,
layerManager: this.layerManager,
layers: this.layers,
lastSelectLayerId: this.lastSelectLayerId,
});
// 执行并将命令添加到历史栈