From e25bc34f079f1d6a7692cbfe1669e047580617e4 Mon Sep 17 00:00:00 2001 From: Michel Bretschneider Date: Sun, 22 Dec 2024 15:37:17 +0100 Subject: [PATCH] fix loco/tender label roation --- ts/RailroadMap.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ts/RailroadMap.ts b/ts/RailroadMap.ts index 8efe044..d7b268e 100644 --- a/ts/RailroadMap.ts +++ b/ts/RailroadMap.ts @@ -993,7 +993,8 @@ export class RailroadMap { if (frameText) { const yaw = normalizeAngle(frame.rotation.yaw); const flip = (yaw > -90) && (yaw < 90); - const transform = flip ? 'rotate(180) translate(0 25)' : 'translate(0 25)'; + const needsRotate = (this.inverted && flip) || (!this.inverted && !flip); + const transform = needsRotate ? 'rotate(180) translate(0 25)' : 'translate(0 25)'; const text = g .text(gvasToString(frameText)) .attr('transform', transform)