From ecd7c5e8dc934f571dd20b71c6a54c03c7eac680 Mon Sep 17 00:00:00 2001 From: fan Date: Thu, 8 Jun 2023 15:18:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=A1=E5=8F=B7=E6=9C=BA=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/graphics/signal/Signal.ts | 4 ---- src/graphics/signal/SignalDrawAssistant.ts | 10 ++++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/graphics/signal/Signal.ts b/src/graphics/signal/Signal.ts index bbb7d49..adb023b 100644 --- a/src/graphics/signal/Signal.ts +++ b/src/graphics/signal/Signal.ts @@ -38,10 +38,6 @@ export class Signal extends JlGraphic { constructor() { super(Signal.Type); - this.codeGraph.draggable = true; - this.codeGraph.selectable = true; - this.codeGraph.rotatable = true; - this.codeGraph.eventMode = 'static'; this.addChild(this.codeGraph); this.addChild(this.humanControl); this.addChild(this.fleetMode); diff --git a/src/graphics/signal/SignalDrawAssistant.ts b/src/graphics/signal/SignalDrawAssistant.ts index 35011d7..ca6d1cf 100644 --- a/src/graphics/signal/SignalDrawAssistant.ts +++ b/src/graphics/signal/SignalDrawAssistant.ts @@ -84,10 +84,20 @@ export class signalInteraction extends GraphicInteractionPlugin { g.cursor = 'pointer'; g.scalable = true; g.rotatable = true; + g.codeGraph.draggable = true; + g.codeGraph.selectable = true; + g.codeGraph.rotatable = true; + g.codeGraph.scalable = true; + g.codeGraph.eventMode = 'static'; } unbind(g: Signal): void { g.eventMode = 'none'; g.scalable = false; g.rotatable = false; + g.codeGraph.draggable = false; + g.codeGraph.selectable = false; + g.codeGraph.rotatable = false; + g.codeGraph.scalable = false; + g.codeGraph.eventMode = 'none'; } }