diff --git a/src/examples/app/graphics/IscsFanInteraction.ts b/src/examples/app/graphics/IscsFanInteraction.ts index 8ec9916..255af32 100644 --- a/src/examples/app/graphics/IscsFanInteraction.ts +++ b/src/examples/app/graphics/IscsFanInteraction.ts @@ -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), diff --git a/src/jlgraphic/utils/GraphicUtils.ts b/src/jlgraphic/utils/GraphicUtils.ts index a710fde..1fbc572 100644 --- a/src/jlgraphic/utils/GraphicUtils.ts +++ b/src/jlgraphic/utils/GraphicUtils.ts @@ -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 {