diff --git a/src/graphics/section/SectionDrawAssistant.ts b/src/graphics/section/SectionDrawAssistant.ts index 9b7a126..8a3ad65 100644 --- a/src/graphics/section/SectionDrawAssistant.ts +++ b/src/graphics/section/SectionDrawAssistant.ts @@ -244,18 +244,25 @@ export class SectionGraphicHitArea implements IHitArea { function buildAbsorbablePositions(section: Section): AbsorbablePosition[] { const aps: AbsorbablePosition[] = []; - const sections = section.queryStore.queryByType
(Section.Type); - sections.forEach((other) => { - const [ps, pe] = [ - other.localToCanvasPoint(other.getStartPoint()), - other.localToCanvasPoint(other.getEndPoint()), - ]; - const { width, height } = section.getGraphicApp().canvas; - const xs = new AbsorbableLine({ x: 0, y: ps.y }, { x: width, y: ps.y }); - const ys = new AbsorbableLine({ x: ps.x, y: 0 }, { x: ps.x, y: height }); - const xe = new AbsorbableLine({ x: 0, y: pe.y }, { x: width, y: pe.y }); - const ye = new AbsorbableLine({ x: pe.x, y: 0 }, { x: pe.x, y: height }); - aps.push(xs, ys, xe, ye); + const [ps, pe] = [ + section.localToCanvasPoint(section.getStartPoint()), + section.localToCanvasPoint(section.getEndPoint()), + ]; + const { width, height } = section.getGraphicApp().canvas; + const xs = new AbsorbableLine({ x: 0, y: ps.y }, { x: width, y: ps.y }); + const ys = new AbsorbableLine({ x: ps.x, y: 0 }, { x: ps.x, y: height }); + const xe = new AbsorbableLine({ x: 0, y: pe.y }, { x: width, y: pe.y }); + const ye = new AbsorbableLine({ x: pe.x, y: 0 }, { x: pe.x, y: height }); + aps.push(xs, ys, xe, ye); + 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);