From fcc864241b728302b1b6d489b244c32d5de4453a Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Thu, 11 Jan 2024 13:21:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/section/SectionDrawAssistant.ts | 35 ++++++++++---------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/graphics/section/SectionDrawAssistant.ts b/src/graphics/section/SectionDrawAssistant.ts index a3df542..7e4465a 100644 --- a/src/graphics/section/SectionDrawAssistant.ts +++ b/src/graphics/section/SectionDrawAssistant.ts @@ -370,25 +370,26 @@ function buildAbsorbablePositions( break; } } - const sections = section.queryStore - .queryByType
(Section.Type) - .filter((g) => g.datas.sectionType == SectionType.Physical); - sections.forEach((item) => { - if (item.id !== section.id) { - item.localToCanvasPoints(...item.datas.points).forEach((p) => { - aps.push(new AbsorbablePoint(p)); - }); - } - }); - const turnouts = section.queryStore.queryByType(Turnout.Type); - turnouts.forEach((turnout) => { - turnout.getPortPoints().forEach((points) => { - turnout.localToCanvasPoints(...points).forEach((p) => { - aps.push(new AbsorbablePoint(p)); + if (section instanceof Section) { + const sections = section.queryStore + .queryByType
(Section.Type) + .filter((g) => g.datas.sectionType == SectionType.Physical); + sections.forEach((item) => { + if (item.id !== section.id) { + item.localToCanvasPoints(...item.datas.points).forEach((p) => { + aps.push(new AbsorbablePoint(p)); + }); + } + }); + const turnouts = section.queryStore.queryByType(Turnout.Type); + turnouts.forEach((turnout) => { + turnout.getPortPoints().forEach((points) => { + turnout.localToCanvasPoints(...points).forEach((p) => { + aps.push(new AbsorbablePoint(p)); + }); }); }); - }); - + } return aps; }