运行线调整

This commit is contained in:
fan 2023-08-01 16:26:57 +08:00
parent e7c755348b
commit bfd937da72
2 changed files with 9 additions and 3 deletions

View File

@ -173,9 +173,10 @@ function onUpdate() {
function generatePathLine() {
const runLine = drawStore.selectedGraphic as RunLine;
if (runLine) {
const points = runLineModel.points;
const points1: Point[] = [];
points.forEach((p) => points1.push(new Point(p.x, p.y)));
runLineModel.points.forEach((p) =>
points1.push(runLine.localToCanvasPoint(new Point(p.x, p.y)))
);
runLine.generatePathLine(points1);
}
}

View File

@ -72,7 +72,12 @@ function buildAbsorbablePositions(Station: StationLine): AbsorbablePosition[] {
runLines.forEach((runLine) => {
const points = runLine.datas.points;
for (let i = 0; i < points.length - 1; i++) {
aps.push(new AbsorbableLine(points[i], points[i + 1]));
aps.push(
new AbsorbableLine(
runLine.localToCanvasPoint(points[i]),
runLine.localToCanvasPoint(points[i + 1])
)
);
}
});
return aps;