Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix schematic port label name using schematic_port.display_pin_label, fix anchoring of bottom text on components, update core #109

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bun.lockb
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export const createSvgObjectsForSchPortPinLabel = (params: {
// Transform the pin position from local to global coordinates
const screenPinNumberTextPos = applyToPoint(transform, realPinNumberPos)

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

if (!label) return []

Expand All @@ -53,7 +55,11 @@ export const createSvgObjectsForSchPortPinLabel = (params: {
y: screenPinNumberTextPos.y.toString(),
style: "font-family: sans-serif;",
fill: colorMap.schematic.pin_number,
"text-anchor": schPort.side_of_component === "left" ? "start" : "end",
"text-anchor":
schPort.side_of_component === "left" ||
schPort.side_of_component === "bottom"
? "start"
: "end",
"dominant-baseline": "middle",
"font-size": `${getSchFontSize(transform, "pin_number")}px`,
transform:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@storybook/react": "^8.2.5",
"@storybook/react-vite": "^8.2.5",
"@storybook/test": "^8.2.5",
"@tscircuit/core": "^0.0.148",
"@tscircuit/core": "^0.0.153",
"@tscircuit/plop": "^0.0.10",
"@types/bun": "^1.1.9",
"bun-match-svg": "^0.0.6",
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.
Loading