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