驾驶台旋钮操作bug修复

This commit is contained in:
joylink_zhaoerwei 2024-08-22 14:31:15 +08:00
parent e5e632104c
commit 8f9c0c852a

View File

@ -148,9 +148,10 @@ export abstract class KeyInteraction<
} }
onMouseDown(e: FederatedMouseEvent) { onMouseDown(e: FederatedMouseEvent) {
const target = e.target as DisplayObject; const target = e.target as DisplayObject;
const g = target.getGraphic<G>(); const g = target.getGraphic<TccKey>();
if (!g) return; if (!g) return;
this.isMouseDown = true; this.isMouseDown = true;
this.ratatingSprite = g._tccKey;
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;