diff --git a/lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchPack.ts b/lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchPack.ts index c02bf6990..6e61bcd39 100644 --- a/lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchPack.ts +++ b/lib/components/primitive-components/Group/Group_doInitialSchematicLayoutMatchPack.ts @@ -1,6 +1,5 @@ import { getCircuitJsonTree, - transformSchematicElements, type CircuitJsonTreeNode, type CircuitJsonUtilObjects, } from "@tscircuit/circuit-json-util" @@ -775,6 +774,9 @@ export function Group_doInitialSchematicLayoutMatchPack< originalDirection, placement.ccwRotationDegrees, ) + port.side_of_component = + (port.facing_direction as "left" | "right" | "top" | "bottom") || + port.side_of_component } // Also rotate text positions diff --git a/tests/repros/__snapshots__/repro67-pinheader-default-facing-direction-schematic.snap.svg b/tests/repros/__snapshots__/repro67-pinheader-default-facing-direction-schematic.snap.svg new file mode 100644 index 000000000..93f4b693a --- /dev/null +++ b/tests/repros/__snapshots__/repro67-pinheader-default-facing-direction-schematic.snap.svg @@ -0,0 +1,26 @@ +-1,-2-1,-1-1,0-1,1-1,2-1,3-1,40,-20,-10,00,10,20,30,41,-21,-11,01,11,21,31,42,-22,-12,02,12,22,32,4P11234P21234 \ No newline at end of file diff --git a/tests/repros/repro67-pinheader-default-facing-direction.test.tsx b/tests/repros/repro67-pinheader-default-facing-direction.test.tsx new file mode 100644 index 000000000..e9d74c068 --- /dev/null +++ b/tests/repros/repro67-pinheader-default-facing-direction.test.tsx @@ -0,0 +1,18 @@ +import { it, expect } from "bun:test" +import { getTestFixture } from "tests/fixtures/get-test-fixture" + +it("repro67: pinheader default facingDirection for autolayout", async () => { + const { circuit } = getTestFixture() + + circuit.add( + + + + + , + ) + + await circuit.renderUntilSettled() + + expect(circuit).toMatchSchematicSnapshot(import.meta.path) +})