Repository navigation
Preserve custom symbol proportions with contain fitting and local viewbox (#4698) - #4706
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Abse2001
marked this pull request as draft
October 16, 2026 21:42
seveibar
reviewed
Oct 16, 2026
This was referenced Oct 16, 2026
seveibar
approved these changes
Oct 16, 2026
Abse2001
marked this pull request as ready for review
October 17, 2026 00:15
Abse2001
added a commit
that referenced
this pull request
Oct 17, 2026
…4705) * test: reproduce stretched custom symbols with contain sizing * test: label legacy and uniform sizing in repro snapshots * test: keep symbol fitting repro on published props * test: reproduce custom-symbol stretching with a round contact * test: document round outline and normalize new snapshots * test: reproduce sizing with a local viewbox instead of a ports flag * test: remove superseded artwork-bounds fixture * test: use reviewed viewbox bounds and compare all fit modes * test: identify fit-mode fixture children * test: use typed schematic labels for fit modes * test: assert cached local bounds and the shape bounds preset * Revert "test: assert cached local bounds and the shape bounds preset" This reverts commit 8cdffb1. * Preserve custom symbol proportions with contain fitting and local viewbox (#4698) (#4706) * fix: preserve custom-symbol proportions with contain fitting * Keep unreleased props dependency isolated to the draft fix * test: resolve round-contact snapshot merge conflicts * test: keep schematic fit-mode labels compatible with JSX props * refactor: name symbol bounds by their local coordinate space * refactor: use the requested symbol local coordinate space name * chore: use published props 0.0.704 for symbol sizing
Contributor
|
Thank you for your contribution! 🎉 PR Rating: ⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uses published
@tscircuit/props@^0.0.704, which includes the symbol props from merged props#942/#943. Both the development dependency and override use the published version.Stack order: merge repro #4705 first, then retarget this PR to
mainbefore merging.Fixes #4698 with
fit="fill" | "contain" | "stretch"and optionalviewbox={{ minX, maxX, minY, maxY }}source bounds. Contain scales both axes uniformly; CSS-style fill and explicit stretch use independent scale factors. Existing defaults retain independent scaling and automatic port-inclusive bounds.Follows Seve’s fit-mode review, min/max viewbox review, and local-symbol-coordinate naming.
The cached bounds property is named
schematicSymbolBoundsInSymbolLocalCoordinateSpacein bothSymbol.tsandISymbol.ts, following Seve’s naming review.The viewbox establishes the local symbol coordinate space (mm, +X right, +Y up). Core translates those min/max bounds into the pre-resize schematic world frame used by child geometry. During width/height sizing the source bounds center maps to the symbol position. Artwork and ports share that transform, including ports outside the source bounds. With no requested width/height, rendering stays unchanged. The sizing transform composes before the rotation in existing PR #4704.
Validation: all five ordinary regressions fail on unchanged core and pass with this fix. The existing all-primitives resize control passes too (6 focused tests total). Full TypeScript checking and the repository dependency guard pass against the installed published props release. Fixtures use round contacts with a cross; the new fit-mode snapshot was rendered and visually inspected. Hosted CI is rerunning for the published dependency update.
Seve’s #2607/#3208 source-geometry and defined-port guidance is followed. Existing merged #4130/#4580 body and routing bounds behavior is preserved. No CI coverage changes.
Stack: repro #4705 → fix #4706. Merge the repro first, then retarget the fix to
main.