From 3b337a7834c0ab8a3b3a20a761974a614d69d627 Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Tue, 20 Jun 2023 09:10:58 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E6=AC=A1=E7=AA=97=E6=96=B9=E5=90=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/trainWindow/TrainWindowDrawAssistant.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/graphics/trainWindow/TrainWindowDrawAssistant.ts b/src/graphics/trainWindow/TrainWindowDrawAssistant.ts index c34ada4..3dbb5b0 100644 --- a/src/graphics/trainWindow/TrainWindowDrawAssistant.ts +++ b/src/graphics/trainWindow/TrainWindowDrawAssistant.ts @@ -102,13 +102,17 @@ export class TrainWindowDraw extends GraphicDrawAssistant< this.app.deleteGraphics(...trainWindowAll); sections.forEach((section) => { const points = section.datas.points; + let direction = 1; + if (points[0].y > 540) { + direction = -1; + } for (let i = 0; i < points.length - 1; i++) { const x = (points[i].x + points[i + 1].x) / 2; const trainWindow = new TrainWindow(); trainWindow.loadData(this.createGraphicData()); trainWindow.position.set( x, - points[i].y - TrainWindowConsts.offsetSection + points[i].y - direction * TrainWindowConsts.offsetSection ); trainWindow.id = GraphicIdGenerator.next(); trainWindow.datas.sectionId = section.id;