Skip to content

fix(pad): default pad dimensions to 1mm when omitted - #801

Open
rudra496 wants to merge 2 commits into
tscircuit:mainfrom
rudra496:fix/pad-default-dimensions
Open

fix(pad): default pad dimensions to 1mm when omitted#801
rudra496 wants to merge 2 commits into
tscircuit:mainfrom
rudra496:fix/pad-default-dimensions

Conversation

@rudra496

Copy link
Copy Markdown

Summary

Fixes #788.

Previously, `pad_def` required `w` and `h` without fallback defaults. When called by bare string `fp.string("pad")`, `pad()` forwarded `undefined` to `mm(w)`, throwing a raw internal `TypeError`.

Changes

  1. Default Dimensions: Made `w`, `h`, `width`, `height`, `s`, and `size` optional in `pad_def` and defaulted width/height to `1mm` in `pad()`, matching the behavior of `smtpad`.
  2. Unit Tests: Added `tests/pad-bare-string.test.ts` verifying that bare string `pad` renders a 1mm pad without error.

Verification

  • `bun test tests/pad-bare-string.test.ts` (2/2 passing).

Fixes tscircuit#788 by making w and h optional in pad_def and defaulting width/height to 1mm in pad(), matching the behavior of smtpad.
@rudra496
rudra496 requested a review from seveibar as a code owner August 15, 2026 20:32
Copilot AI lite review requested due to automatic review settings August 15, 2026 20:32
@rudra496
rudra496 requested a review from techmannih as a code owner August 15, 2026 20:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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.

pad throws a raw TypeError from a bare name while smtpad defaults its dimensions

2 participants