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;