Skip to content

Commit

Permalink
Merge pull request #134 from anas-sarkez/main
Browse files Browse the repository at this point in the history
Render pin labels for the PinHeader component in SVG
  • Loading branch information
AnasSarkiz authored Nov 19, 2024
2 parents 0425ab9 + f4dabba commit c6f40db
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const createSvgObjectsForSchPortPinLabel = (params: {

const label =
schPort.display_pin_label ??
schComponent.port_labels?.[`pin${schPort.pin_number}`]
schComponent.port_labels?.[`${schPort.pin_number}`]

if (!label) return []

Expand Down
2 changes: 1 addition & 1 deletion tests/sch/__snapshots__/kicad-theme-demo.snap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 18 additions & 1 deletion tests/sch/kicad-theme-demo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,24 @@ it("example 4: kicad theme demo", async () => {
schX={2}
/>
<trace from=".R1 > .pin2" to=".C1 > .pin1" />

<pinheader
name="pin1"
schX={0}
schY={-2}
pinCount={10}
pinLabels={[
"pin1",
"pin2",
"pin3",
"pin4",
"pin5",
"pin6",
"pin7",
"pin8",
"pin9",
"pin10",
]}
/>
<chip
name="U2"
manufacturerPartNumber="ATmega8-16A"
Expand Down

0 comments on commit c6f40db

Please sign in to comment.