Squashed commit of the following:
All checks were successful
CI / Docker-Build (push) Successful in 1m54s
All checks were successful
CI / Docker-Build (push) Successful in 1m54s
commit 89012e6290
Author: joylink_zhaoerwei <Bob_Engineer@163.com>
Date: Thu May 9 16:08:02 2024 +0800
列车驾驶台方向按钮操作失败会回到之前的位置
This commit is contained in:
parent
60ca381302
commit
9e8abf4624
@ -107,7 +107,6 @@ export abstract class KeyInteraction<
|
|||||||
mouseDownBeginRotation = 0;
|
mouseDownBeginRotation = 0;
|
||||||
changeRotation = 0;
|
changeRotation = 0;
|
||||||
keyInteractionConfig: IKeyInteractionConfig;
|
keyInteractionConfig: IKeyInteractionConfig;
|
||||||
lastTimenRotation = 0;
|
|
||||||
constructor(
|
constructor(
|
||||||
name: string,
|
name: string,
|
||||||
app: IGraphicScene,
|
app: IGraphicScene,
|
||||||
@ -155,7 +154,7 @@ export abstract class KeyInteraction<
|
|||||||
this.mouseDownBeginPos = this.app.toCanvasCoordinates(e.global);
|
this.mouseDownBeginPos = this.app.toCanvasCoordinates(e.global);
|
||||||
this.mouseDownBeginRotation = this.ratatingSprite.rotation;
|
this.mouseDownBeginRotation = this.ratatingSprite.rotation;
|
||||||
this.changeRotation = this.mouseDownBeginRotation;
|
this.changeRotation = this.mouseDownBeginRotation;
|
||||||
this.lastTimenRotation = this.ratatingSprite.rotation;
|
useTccStore().tccKeyLastRotation = this.ratatingSprite.rotation;
|
||||||
}
|
}
|
||||||
onMousemove(e: FederatedMouseEvent) {
|
onMousemove(e: FederatedMouseEvent) {
|
||||||
const target = e.target as DisplayObject;
|
const target = e.target as DisplayObject;
|
||||||
@ -204,8 +203,7 @@ export abstract class KeyInteraction<
|
|||||||
this.changeRotation = this.mouseDownBeginRotation - Math.PI / 2;
|
this.changeRotation = this.mouseDownBeginRotation - Math.PI / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.lastTimenRotation !== this.changeRotation) {
|
if (this.ratatingSprite.rotation !== this.changeRotation) {
|
||||||
this.lastTimenRotation = this.changeRotation;
|
|
||||||
this.ratatingSprite.rotation = this.changeRotation;
|
this.ratatingSprite.rotation = this.changeRotation;
|
||||||
useTccStore().onMouseUpFromTccKeyDir();
|
useTccStore().onMouseUpFromTccKeyDir();
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ export const useTccStore = defineStore('tcc', {
|
|||||||
tccHandleId: 0,
|
tccHandleId: 0,
|
||||||
mouseDownOnTccKeyDir: false,
|
mouseDownOnTccKeyDir: false,
|
||||||
tccKeyDirId: 0,
|
tccKeyDirId: 0,
|
||||||
|
tccKeyLastRotation: 0,
|
||||||
}),
|
}),
|
||||||
actions: {
|
actions: {
|
||||||
getTccScene() {
|
getTccScene() {
|
||||||
@ -84,9 +85,14 @@ export const useTccStore = defineStore('tcc', {
|
|||||||
dirKey: {
|
dirKey: {
|
||||||
val: position,
|
val: position,
|
||||||
},
|
},
|
||||||
}).catch((err) => {
|
})
|
||||||
errorNotify('操作失败', { message: err.origin.response.data.title });
|
.then(() => {
|
||||||
});
|
this.tccKeyLastRotation = tccKeyDir._tccKey.rotation;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
errorNotify('操作失败', { message: err.origin.response.data.title });
|
||||||
|
tccKeyDir._tccKey.rotation = this.tccKeyLastRotation;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user