部件选取

This commit is contained in:
李志鹏
2026-01-26 16:16:40 +08:00
parent ba49b02ebe
commit 9cecbdcf9b
11 changed files with 245 additions and 144 deletions

View File

@@ -147,11 +147,11 @@ export class LassoCutoutCommand extends CompositeCommand {
}
// 确定源图层
const sourceLayer = this.layerManager.getActiveLayer();
if (!sourceLayer) {
console.error("无法执行套索抠图:源图层无效");
return false;
}
// const sourceLayer = this.layerManager.getActiveLayer();
// if (!sourceLayer) {
// console.error("无法执行套索抠图:源图层无效");
// return false;
// }
// 获取源图层的所有对象(包括子图层)
// const sourceObjects = this._getLayerObjects(sourceLayer);
@@ -225,7 +225,7 @@ export class LassoCutoutCommand extends CompositeCommand {
const layers = this.layerManager.layers.value;
var topLayerIndex = 0;
layers.forEach((layer, index) => {
if(this.originalLayer)layers.forEach((layer, index) => {
if (layer.id === this.originalLayer.id) {
topLayerIndex = index;
}else if (layer.children.length > 0) {