Skip to content

Commit

Permalink
THR gauge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
flogross89 committed Nov 23, 2024
1 parent 6d4a60b commit 1104ba1
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -497,10 +497,12 @@ export class GaugeThrustComponent extends DisplayComponent<GaugeThrustComponentP
y: this.props.y + valueMaxDir.y * this.props.radius,
};

const diffAngle = valueMaxDir.angle - valueIdleDir.angle;

return [
`M ${this.props.x},${this.props.y} L ${valueIdleEnd.x},${valueIdleEnd.y}`,
`A ${this.props.radius} ${this.props.radius} 0 ${this.props.reverse ? '0' : '1'} 1 ${valueMaxEnd.x} ${valueMaxEnd.y}`,
`M ${valueMaxEnd.x} ${valueMaxEnd.y} L ${this.props.x},${this.props.y}`,
`M ${this.props.x},${this.props.y} L ${valueIdleEnd.x.toFixed(2)},${valueIdleEnd.y.toFixed(2)}`,
`A ${this.props.radius} ${this.props.radius} 0 ${Math.abs(diffAngle) < 180 || this.props.reverse ? '0' : '1'} 1 ${valueMaxEnd.x.toFixed(2)} ${valueMaxEnd.y.toFixed(2)}`,
`M ${valueMaxEnd.x.toFixed(2)} ${valueMaxEnd.y.toFixed(2)} L ${this.props.x},${this.props.y}`,
].join(' ');
},
this.valueIdleSub,
Expand Down

0 comments on commit 1104ba1

Please sign in to comment.