diff --git a/src/graphics/signal/Signal.ts b/src/graphics/signal/Signal.ts index c8820af..f0ebf2c 100644 --- a/src/graphics/signal/Signal.ts +++ b/src/graphics/signal/Signal.ts @@ -54,6 +54,15 @@ export class Signal extends JlGraphic { return this.getDatas(); } + get mirror(): boolean { + return this.datas.mirror; + } + set mirror(v: boolean) { + const old = this.datas.clone(); + old.mirror = v; + this.updateData(old); + } + paint(): void { const mirror = this.datas.mirror; this.lampMainBody.paint(signalConsts.lampNum, mirror); diff --git a/src/graphics/signal/SignalDrawAssistant.ts b/src/graphics/signal/SignalDrawAssistant.ts index 3730017..5b51bcc 100644 --- a/src/graphics/signal/SignalDrawAssistant.ts +++ b/src/graphics/signal/SignalDrawAssistant.ts @@ -158,9 +158,8 @@ export class signalInteraction extends GraphicInteractionPlugin { const signal = target.getGraphic() as Signal; this.app.updateSelected(signal); mirrorFlipConfig.handler = () => { - signal.datas.mirror = !signal.datas.mirror; - signal.doRepaint(); - // console.log('*****mirror', signal); + signal.mirror = !signal.mirror; + // signal.doRepaint(); }; SignalEditMenu.open(e.global); }