道岔和物理区段的联动拖动

This commit is contained in:
Yuan 2023-07-12 14:14:38 +08:00
parent 6bd8bf17b9
commit ac6c8cc137
2 changed files with 10 additions and 0 deletions

View File

@ -302,6 +302,11 @@ class SectionPolylineEditPlugin extends PolylineEditPlugin {
relation.getRelationParam(this.graphic).param === SectionPort.B
);
}
relations = relations.filter(
(relation) =>
relation.getOtherGraphic(this.graphic) instanceof Turnout ||
relation.getOtherGraphic(this.graphic) instanceof Section
);
if (!relations.length) return;
const points: IPointData[] = [];
const otherGraphics = relations.map((relation) =>

View File

@ -410,6 +410,11 @@ export class TurnoutEditPlugin extends GraphicEditPlugin<Turnout> {
relation.getRelationParam(this.graphic).param === TurnoutPort.C
);
}
relations = relations.filter(
(relation) =>
relation.getOtherGraphic(this.graphic) instanceof Turnout ||
relation.getOtherGraphic(this.graphic) instanceof Section
);
if (!relations.length) return;
const otherGraphics = relations.map((relation) =>
relation.getOtherGraphic(this.graphic)