修改遍历查询子元素bug
This commit is contained in:
parent
5f7052ba9b
commit
7cc46be20f
@ -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),
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user