feat: 优化部分问题,完善选区功能

This commit is contained in:
bighuixiang
2025-07-04 03:16:18 +08:00
parent b6afd2764d
commit 0615ab31f9
12 changed files with 1892 additions and 1144 deletions

View File

@@ -34,13 +34,21 @@ export class AddLayerCommand extends Command {
this.insertIndex = options.insertIndex;
this.oldActiveLayerId = null;
this.beforeLayers = [...this.layers.value]; // 备份原图层列表
this.options = options.options || {};
}
execute() {
// 保存当前活动图层ID
this.oldActiveLayerId = this.activeLayerId.value;
// 执行添加图层操作
// 执行添加顶级图层操作
if (this.options?.insertTop) {
this.layers.value.splice(0, 0, this.newLayer);
this.activeLayerId.value = this.newLayer.id;
return this.newLayer.id;
}
// 智能插入图层到合适位置
this._insertLayerAtCorrectPosition(this.newLayer);
// if (this.insertIndex !== undefined && this.insertIndex !== null) {