feat: 优化部分问题,完善选区功能
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user