Skip to content

Commit ef516f9

Browse files
committed
keep negative values for overrotation
1 parent e8d379e commit ef516f9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/frontend/components/Input/InputSteer/RotationIndicator.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe('RotationIndicator', () => {
1818
it('should render when angle exceeds threshold clockwise', () => {
1919
render(<RotationIndicator currentAngleRad={280 * (Math.PI / 180)} />);
2020

21-
expect(screen.getByText('280°')).toBeInTheDocument();
21+
expect(screen.getByText('-280°')).toBeInTheDocument();
2222
});
2323

2424
it('should render when angle exceeds threshold counterclockwise', () => {
@@ -30,6 +30,6 @@ describe('RotationIndicator', () => {
3030
it('should render with extreme angle', () => {
3131
render(<RotationIndicator currentAngleRad={350 * (Math.PI / 180)} />);
3232

33-
expect(screen.getByText('350°')).toBeInTheDocument();
33+
expect(screen.getByText('-350°')).toBeInTheDocument();
3434
});
3535
});

src/frontend/components/Input/InputSteer/RotationIndicator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export function RotationIndicator({
7878

7979
{/* Centered text */}
8080
<div className="absolute top-1/8 text-xs text-white min-w-[2.5rem] text-center font-medium bg-black/40 rounded-md">
81-
{shouldShow ? `${Math.abs(angleDegrees).toFixed(0)}°` : ''}
81+
{shouldShow ? `${angleDegrees.toFixed(0)}°` : ''}
8282
</div>
8383
</div>
8484
);

0 commit comments

Comments
 (0)