Skip to content

Fix rotation for CourtyardRect#2052

Merged
MustafaMulla29 merged 2 commits intomainfrom
fix/ccw-rect
Mar 13, 2026
Merged

Fix rotation for CourtyardRect#2052
MustafaMulla29 merged 2 commits intomainfrom
fix/ccw-rect

Conversation

@MustafaMulla29
Copy link
Contributor

No description provided.

@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
tscircuit-core-benchmarks Ready Ready Preview, Comment Mar 13, 2026 5:39pm

Request Review

Copy link
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See important comment

@MustafaMulla29 MustafaMulla29 merged commit 88e3451 into main Mar 13, 2026
10 checks passed
@MustafaMulla29 MustafaMulla29 deleted the fix/ccw-rect branch March 13, 2026 17:41
},
width: props.width,
height: props.height,
ccw_rotation: ccw_rotation || undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical Bug: Zero rotation will be stored as undefined

The expression ccw_rotation || undefined will incorrectly evaluate to undefined when ccw_rotation is 0 (zero degrees). This is because 0 is a falsy value in JavaScript.

Impact: Components with 0° rotation will have their rotation stored as undefined instead of 0, potentially breaking rotation-dependent logic elsewhere in the codebase.

Fix: Either remove the || undefined entirely, or use a proper nullish check:

ccw_rotation: ccw_rotation ?? undefined,

or simply:

ccw_rotation: ccw_rotation,
Suggested change
ccw_rotation: ccw_rotation || undefined,
ccw_rotation: ccw_rotation,

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@tscircuitbot
Copy link
Contributor


Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants