diff --git a/src/drawApp/graphics/TurnoutInteraction.ts b/src/drawApp/graphics/TurnoutInteraction.ts index 54cf644..4a63b1f 100644 --- a/src/drawApp/graphics/TurnoutInteraction.ts +++ b/src/drawApp/graphics/TurnoutInteraction.ts @@ -37,8 +37,8 @@ function getDefaultEndPoint() { }; } -const setNormalPosition: MenuItemOptions = { name: '设置定位' }; -const setReversePosition: MenuItemOptions = { name: '设置反位' }; +const setNormalPosition: MenuItemOptions = { name: '定操' }; +const setReversePosition: MenuItemOptions = { name: '反操' }; const addTrainConfig: MenuItemOptions = { name: '添加列车', diff --git a/src/graphics/train/Train.ts b/src/graphics/train/Train.ts index 567a956..0789ad3 100644 --- a/src/graphics/train/Train.ts +++ b/src/graphics/train/Train.ts @@ -418,8 +418,9 @@ export class Train extends JlGraphic { const px = startP.x + Math.round(offset * (endP.x - startP.x)); const py = startP.y + Math.round(offset * (endP.y - startP.y)); let angle = Math.atan2(endP.y - startP.y, endP.x - startP.x); - if (-Math.PI / 2 > angle) { - angle = -(angle + Math.PI); + const exact = Math.PI / 16; + if (-Math.PI / 2 - exact > angle) { + angle = angle + Math.PI; } if (Math.PI / 2 <= angle) { angle = angle - Math.PI;