修改遍历查询子元素bug

This commit is contained in:
walker 2023-06-25 11:34:16 +08:00
parent 5f7052ba9b
commit 7cc46be20f
2 changed files with 4 additions and 2 deletions

View File

@ -47,6 +47,7 @@ export class IscsFanState extends GraphicStateBase implements IIscsFanState {
let states;
if (proto) {
states = proto;
states.common.graphicType = IscsFan.Type;
} else {
states = new graphicStates.IscsFan({
common: GraphicStateBase.defaultCommonState(IscsFan.Type),

View File

@ -67,15 +67,16 @@ export function recursiveFindChild(
container: Container,
finder: (child: DisplayObject) => boolean
): DisplayObject | null {
let result = null;
for (let i = 0; i < container.children.length; i++) {
const child = container.children[i];
if (finder(child)) {
return child;
} else if (child.children) {
return recursiveFindChild(child as Container, finder);
result = recursiveFindChild(child as Container, finder);
}
}
return null;
return result;
}
export interface BezierParam {