diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index 0789ad3..3d9df6f 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -144,7 +144,12 @@ export class TrainHead extends Container { -marginX - pauseW / 2 - codeWidth / 2, codeHeight / 2, ]; - if (states.runDirection) { + // 道岔时运行上下行决定箭头方向 + // 区段时是否从A到B决定箭头方向 + if ( + (states.devicePort && states.runDirection) || + (!states.devicePort && states.pointTo) + ) { const aP: Array = []; arrowPoint.forEach((item, index) => { if (index % 2 == 1) { @@ -155,7 +160,10 @@ export class TrainHead extends Container { }); arrowPoint = aP; } - if (states.headDirection) { + if ( + (states.devicePort && states.headDirection) || + (!states.devicePort && states.pointTo) + ) { const pP: Array = []; pausePoint.forEach((item, index) => { if (index % 2 == 1) {