From 63052c4617c5ce28de13ef1f217f15e86c57d8fc Mon Sep 17 00:00:00 2001 From: joylink_zhaoerwei Date: Mon, 19 Jun 2023 15:29:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/trainWindow/TrainWindowDrawAssistant.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/graphics/trainWindow/TrainWindowDrawAssistant.ts b/src/graphics/trainWindow/TrainWindowDrawAssistant.ts index 7ef5740..8d2eb91 100644 --- a/src/graphics/trainWindow/TrainWindowDrawAssistant.ts +++ b/src/graphics/trainWindow/TrainWindowDrawAssistant.ts @@ -101,8 +101,11 @@ export class TrainWindowDraw extends GraphicDrawAssistant< this.storeGraphic(...trainWindows); } oneGenerates() { - const trainWindows: TrainWindow[] = []; const sections = this.app.queryStore.queryByType
(Section.Type); + const trainWindowAll = this.app.queryStore.queryByType( + TrainWindow.Type + ); + this.app.deleteGraphics(...trainWindowAll); sections.forEach((section) => { const points = section.datas.points; for (let i = 0; i < points.length - 1; i++) { @@ -115,10 +118,10 @@ export class TrainWindowDraw extends GraphicDrawAssistant< ); trainWindow.id = GraphicIdGenerator.next(); trainWindow.datas.sectionId = section.id; - trainWindows.push(trainWindow); + this.storeGraphic(trainWindow); + trainWindow.loadRealtions(); } }); - this.storeGraphic(...trainWindows); } }