Skip to content

Commit

Permalink
fix loco/tender label roation
Browse files Browse the repository at this point in the history
  • Loading branch information
embix committed Dec 22, 2024
1 parent a76f379 commit e25bc34
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ts/RailroadMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e25bc34

Please sign in to comment.