Skip to content

Add symbol contain fitting and local viewbox bounds (#4698) - #942

Merged
Abse2001 merged 5 commits into
mainfrom
repro/symbol-contain
Oct 17, 2026
Merged

Abse2001 merged 5 commits into
mainfrom
repro/symbol-contain

Conversation

@Abse2001

@Abse2001 Abse2001 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Custom symbols need a way to preserve their proportions during sizing and define their own source bounds. Adds optional fit="fill" | "contain" | "stretch" and viewbox={{ minX, maxX, minY, maxY }} to the public symbol props and runtime validation, enabling tscircuit/core#4706.

contain requests uniform scaling; CSS-style fill and explicit stretch retain independent scaling. Viewbox bounds use the local symbol coordinate space (mm, +X right, +Y up), accept numbers or distance strings, and require maxX > minX and maxY > minY. Existing defaults are preserved. Generated API documentation is included.

Follows Seve’s fit-mode review and min/max bounds review.

Validation: all 683 tests, full TypeScript checking, package/declaration build, and all four documentation generators pass. The current PR head has the same Git tree as the validated fix. Hosted test, typecheck, formatting, and package-preview checks are green.

Includes the fix already merged in #943. This PR targets main and now contains both the repro tests and their implementation, with ordinary passing assertions. After it lands and a props release is published, core#4706 can replace its preview dependency with that published version.

@Abse2001 Abse2001 changed the title Reproduce discarded symbol fit and bounds options (#4698) Repro: symbol parser discards contain fitting and local viewbox (#4698) Oct 16, 2026
@Abse2001 Abse2001 changed the title Repro: symbol parser discards contain fitting and local viewbox (#4698) Add symbol contain fitting and local viewbox bounds (#4698) Oct 17, 2026
@Abse2001
Abse2001 merged commit fe266f8 into main Oct 17, 2026
7 checks passed
@tscircuitbot

Copy link
Copy Markdown
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.

2 participants