From e2885de447ecfaeb91af25a649eda0ba15c6fbbd Mon Sep 17 00:00:00 2001 From: seveibar Date: Sat, 8 Aug 2026 12:18:29 -0700 Subject: [PATCH] Rotate vertical inline net labels in the debug visualization A vertical trace's inline label was drawn horizontally across the wire in visualize() output. graphics-debug texts now support rotation, so pass 90 (counter-clockwise, bottom-to-top) for y-axis labels. Needs graphics-debug with Text.rotation (tscircuit/graphics-debug#228); the devDependency bump lands here once that releases. Co-Authored-By: Claude Opus 5 --- .../InlineNetLabelSolver.ts | 2 ++ package.json | 2 +- .../__snapshots__/inline-net-label01.snap.svg | 20 +++++++++---------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/solvers/InlineNetLabelSolver/InlineNetLabelSolver.ts b/lib/solvers/InlineNetLabelSolver/InlineNetLabelSolver.ts index 691333db9..402be6526 100644 --- a/lib/solvers/InlineNetLabelSolver/InlineNetLabelSolver.ts +++ b/lib/solvers/InlineNetLabelSolver/InlineNetLabelSolver.ts @@ -344,6 +344,8 @@ export class InlineNetLabelSolver extends BaseSolver { color: "green", fontSize: inlineLabel.height, anchorSide: "center", + // Vertical labels read bottom-to-top, alongside the wire they name. + rotation: inlineLabel.axis === "y" ? 90 : undefined, }) graphics.points.push({ x: inlineLabel.anchorPoint.x, diff --git a/package.json b/package.json index 85f68647b..599f1d2d1 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "calculate-elbow": "^0.0.12", "connectivity-map": "^1.0.0", "flatbush": "^4.5.0", - "graphics-debug": "^0.0.96", + "graphics-debug": "^0.0.98", "react": "^19.1.1", "react-cosmos": "^7.0.0", "react-cosmos-plugin-vite": "^7.0.0", diff --git a/tests/solvers/InlineNetLabelSolver/__snapshots__/inline-net-label01.snap.svg b/tests/solvers/InlineNetLabelSolver/__snapshots__/inline-net-label01.snap.svg index 87510f153..f5ffc12c6 100644 --- a/tests/solvers/InlineNetLabelSolver/__snapshots__/inline-net-label01.snap.svg +++ b/tests/solvers/InlineNetLabelSolver/__snapshots__/inline-net-label01.snap.svg @@ -1,14 +1,14 @@ -USER_LED_ANODESPI_SCK