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

@@ -475,7 +475,10 @@ export function cloneLayer(layer) {
export function findLayerRecursively(layers, layerId, parent = null) {
try {
if (!layers || !Array.isArray(layers) || !layerId) {
return null;
return {
layer: null,
parent: null,
};
}
// 在当前图层列表中查找
@@ -499,11 +502,17 @@ export function findLayerRecursively(layers, layerId, parent = null) {
}
} catch (error) {
console.error(`查找图层 ${layerId} 时出错:`, error);
return null;
return {
layer: null,
parent: null,
};
}
console.warn(`图层 ${layerId} 未找到`);
return null;
return {
layer: null,
parent: null,
};
}
/**