feat: add port-name-padding parameter

Replaces the hard-coded 2pt padding used when placing port name labels.
Configurable per element via port-name-padding on elmt (forwarded by
block and group), defaulting to 2pt to preserve existing layout.
This commit is contained in:
David Stadelmann committed 2026-10-22 00:29:52 +02:00
1 parent 13e3fee913
commit c14e2ceab9
8 files changed
+6464 -6269

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

+3 -1
View File
@@ -6,7 +6,7 @@
#set page(width: auto, height: auto, margin: .5cm)
#circuit({
// --- Group with port labels OUTSIDE (default) ---
// --- Group with port labels INSIDE (outside-port-names: false) ---
element.group(
id: "cpu",
name: "CPU (labels outside)",
@@ -14,6 +14,7 @@
stroke: (dash: "dashed"),
fill: util.colors.yellow.lighten(60%),
padding: 1em,
port-name-padding: .5em,
outside-port-names: true,
ports: (
west: (
@@ -51,6 +52,7 @@
fill: util.colors.yellow.lighten(60%),
padding: 4em,
outside-port-names: false,
port-name-padding: 0.5em,
ports: (
west: (
(id: "in1", name: "D1"),