镜像处理逻辑调整

This commit is contained in:
fan 2023-06-16 14:49:15 +08:00
parent a116149775
commit 3239e8862e
2 changed files with 11 additions and 3 deletions

View File

@ -54,6 +54,15 @@ export class Signal extends JlGraphic {
return this.getDatas<ISignalData>();
}
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);

View File

@ -158,9 +158,8 @@ export class signalInteraction extends GraphicInteractionPlugin<Signal> {
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);
}