Fix schStemLength scaling for resized custom symbol ports#1964
Closed
Fix schStemLength scaling for resized custom symbol ports#1964
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This PR has been automatically marked as stale because it has had no recent activity. It will be closed if no further activity occurs. |
|
This PR was closed because it has been inactive for 1 day since being marked as stale. |
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.
Motivation
<symbol />elements with explicitwidth/heightwere not scaling their schematic stem length (schStemLength) to match the symbol resize, causing incorrectschematic_port.distance_from_component_edgeand stem line endpoints after symbol scaling.Description
schematic_stem_line_idtoPortand store the created schematic line so it can be updated later during symbol resize inlib/components/primitive-components/Port/Port.ts.doInitialSchematicSymbolResizeonPortto recompute scaled stem length from the symbol transform and updateschematic_port.distance_from_component_edgeand the stem line endpoint (x2/y2) based on portdirection.schStemLengthor symbols without explicit sizing and keep initial port/stem creation logic intact.tests/components/primitive-components/port-sch-stem-length.test.tsxthat asserts stem scaling for horizontal and vertical directions inside a resized custom symbol.Testing
BUN_UPDATE_SNAPSHOTS=1 bun test tests/components/primitive-components/port-sch-stem-length.test.tsx tests/components/primitive-components/port-sch-stem-length-connected.test.tsxand both tests passed.bunx tsc --noEmitfor type checking and it completed with no errors.bun run formatwhich formatted files successfully.Codex Task