From a9abf6f12798da13d9467b883952a82f32f06b69 Mon Sep 17 00:00:00 2001 From: seveibar Date: Mon, 4 Nov 2024 20:11:39 -0800 Subject: [PATCH] new methods, absolute positions used, function breakdowns --- .../convert-circuit-json-to-schematic-svg.ts | 7 +- ...reate-svg-objects-for-sch-port-box-line.ts | 107 +++++++++ ...eate-svg-objects-for-sch-port-pin-label.ts | 0 ...vg-objects-for-sch-port-pin-number-text.ts | 106 +++++++++ ...svg-objects-from-sch-component-with-box.ts | 222 ++---------------- ...create-svg-objects-from-sch-port-on-box.ts | 153 ++++++++++++ .../get-unit-vector-from-outside-to-edge.ts | 21 ++ tests/sch/__snapshots__/debug-object.snap.svg | 2 +- .../__snapshots__/grid-and-points.snap.svg | 2 +- .../__snapshots__/kicad-theme-demo.snap.svg | 4 +- 10 files changed, 419 insertions(+), 205 deletions(-) create mode 100644 lib/sch/svg-object-fns/create-svg-objects-for-sch-port-box-line.ts create mode 100644 lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-label.ts create mode 100644 lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-number-text.ts create mode 100644 lib/sch/svg-object-fns/create-svg-objects-from-sch-port-on-box.ts create mode 100644 lib/utils/get-unit-vector-from-outside-to-edge.ts diff --git a/lib/sch/convert-circuit-json-to-schematic-svg.ts b/lib/sch/convert-circuit-json-to-schematic-svg.ts index e293688..7780c10 100644 --- a/lib/sch/convert-circuit-json-to-schematic-svg.ts +++ b/lib/sch/convert-circuit-json-to-schematic-svg.ts @@ -33,7 +33,6 @@ export function convertCircuitJsonToSchematicSvg( const realBounds = getSchematicBoundsFromCircuitJson(circuitJson) const realWidth = realBounds.maxX - realBounds.minX const realHeight = realBounds.maxY - realBounds.minY - console.log({ realWidth, realHeight }) const svgWidth = options?.width ?? 1200 const svgHeight = options?.height ?? 600 @@ -109,7 +108,6 @@ export function convertCircuitJsonToSchematicSvg( const schComponentSvgs: SvgObject[] = [] const schTraceSvgs: SvgObject[] = [] - // Process all elements using transform for (const elm of circuitJson) { if (elm.type === "schematic_debug_object") { schDebugObjectSvgs.push( @@ -148,6 +146,9 @@ export function convertCircuitJsonToSchematicSvg( children: [ { type: "text", + + // DO NOT USE THESE CLASSES!!!! + // PUT STYLES IN THE SVG OBJECTS THEMSELVES value: ` .boundary { fill: ${colorMap.schematic.background}; } .schematic-boundary { fill: none; stroke: #fff; stroke-width: 0.3; } @@ -156,7 +157,7 @@ export function convertCircuitJsonToSchematicSvg( .component-pin { fill: none; stroke: ${colorMap.schematic.component_outline}; } .trace { stroke: ${colorMap.schematic.wire}; stroke-width: 2px; fill: none; } .text { font-family: Arial, sans-serif; font-size: 2px; fill: ${colorMap.schematic.wire}; } - .pin-number { font-size: 0.15px; fill: ${colorMap.schematic.pin_number}; } + .pin-number { fill: ${colorMap.schematic.pin_number}; } .port-label { fill: ${colorMap.schematic.reference}; } .component-name { font-size: 0.25px; fill: ${colorMap.schematic.reference}; } `, diff --git a/lib/sch/svg-object-fns/create-svg-objects-for-sch-port-box-line.ts b/lib/sch/svg-object-fns/create-svg-objects-for-sch-port-box-line.ts new file mode 100644 index 0000000..92e0653 --- /dev/null +++ b/lib/sch/svg-object-fns/create-svg-objects-for-sch-port-box-line.ts @@ -0,0 +1,107 @@ +import type { + AnyCircuitElement, + SchematicComponent, + SchematicPort, +} from "circuit-json" +import type { SvgObject } from "lib/svg-object" +import { applyToPoint, type Matrix } from "transformation-matrix" +import { su } from "@tscircuit/soup-util" + +const PIN_CIRCLE_RADIUS_PX = 3 + +/** + * The schematic port box line is the line and circle that goes from the edge + * of the component box to the port. + */ +export const createSvgObjectsForSchPortBoxLine = ({ + schPort, + schComponent, + transform, + circuitJson, +}: { + schPort: SchematicPort + schComponent: SchematicComponent + transform: Matrix + circuitJson: AnyCircuitElement[] +}): SvgObject[] => { + const svgObjects: SvgObject[] = [] + + const srcPort = su(circuitJson as any).source_port.get(schPort.source_port_id) + + const realEdgePos = { + x: schPort.center.x, + y: schPort.center.y, + } + + // schPort.distance_from_component_edge is currently calculated incorrectly + // in core + const realPinLineLength = 0.2 // schPort.distance_from_component_edge ?? 0.2 + + switch (schPort.side_of_component) { + case "left": + realEdgePos.x += realPinLineLength + break + case "right": + realEdgePos.x -= realPinLineLength + break + case "top": + realEdgePos.y += realPinLineLength + break + case "bottom": + realEdgePos.y -= realPinLineLength + break + } + + const screenSchPortPos = applyToPoint(transform, schPort.center) + const screenRealEdgePos = applyToPoint(transform, realEdgePos) + + // Subtract the pin circle radius from the pin line length to get the end + const screenLineEnd = applyToPoint(transform, schPort.center) + switch (schPort.side_of_component) { + case "left": + screenLineEnd.x += PIN_CIRCLE_RADIUS_PX + break + case "right": + screenLineEnd.x -= PIN_CIRCLE_RADIUS_PX + break + case "top": + screenLineEnd.y -= PIN_CIRCLE_RADIUS_PX + break + case "bottom": + screenLineEnd.y += PIN_CIRCLE_RADIUS_PX + break + } + + // Add port line + svgObjects.push({ + name: "line", + type: "element", + attributes: { + class: "component-pin", + x1: screenLineEnd.x.toString(), + y1: screenLineEnd.y.toString(), + x2: screenRealEdgePos.x.toString(), + y2: screenRealEdgePos.y.toString(), + "stroke-width": "2px", + }, + value: "", + children: [], + }) + + // Add port circle + svgObjects.push({ + name: "circle", + type: "element", + attributes: { + class: "component-pin", + cx: screenSchPortPos.x.toString(), + cy: screenSchPortPos.y.toString(), + r: PIN_CIRCLE_RADIUS_PX.toString(), + "stroke-width": "2px", + }, + value: "", + children: [], + }) + + return svgObjects +} diff --git a/lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-label.ts b/lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-label.ts new file mode 100644 index 0000000..e69de29 diff --git a/lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-number-text.ts b/lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-number-text.ts new file mode 100644 index 0000000..906607a --- /dev/null +++ b/lib/sch/svg-object-fns/create-svg-objects-for-sch-port-pin-number-text.ts @@ -0,0 +1,106 @@ +import type { + AnyCircuitElement, + SchematicComponent, + SchematicPort, +} from "circuit-json" +import type { SvgObject } from "lib/svg-object" +import { colorMap } from "lib/utils/colors" +import { getUnitVectorFromOutsideToEdge } from "lib/utils/get-unit-vector-from-outside-to-edge" +import { applyToPoint, type Matrix } from "transformation-matrix" + +export const createSvgObjectsForSchPortPinNumberText = (params: { + schPort: SchematicPort + schComponent: SchematicComponent + transform: Matrix + circuitJson: AnyCircuitElement[] +}): SvgObject[] => { + const svgObjects: SvgObject[] = [] + const { schPort, schComponent, transform, circuitJson } = params + + const pinNumberOffset = 0.2 + let localPinNumberTextX = schPort.center.x + let localPinNumberTextY = schPort.center.y + let dominantBaseline = "auto" + let textAnchor = "middle" + + switch (schPort.side_of_component) { + case "top": + // For top ports, stay at the same X but offset Y upward + localPinNumberTextY = schPort.center.y - pinNumberOffset // Move above the circle + localPinNumberTextX = schPort.center.x // Stay aligned with port + dominantBaseline = "middle" + break + case "bottom": + // For bottom ports, stay at the same X but offset Y downward + localPinNumberTextY = schPort.center.y + pinNumberOffset + localPinNumberTextX = schPort.center.x + dominantBaseline = "middle" + textAnchor = "left" + break + case "left": + // For left ports, stay at the same Y but offset X + localPinNumberTextX = schPort.center.x - pinNumberOffset + localPinNumberTextY = schPort.center.y + pinNumberOffset / 4 + dominantBaseline = "auto" + break + case "right": + // For right ports, stay at the same Y but offset X + localPinNumberTextX = schPort.center.x + pinNumberOffset + localPinNumberTextY = schPort.center.y + pinNumberOffset / 4 + dominantBaseline = "auto" + break + } + + const realPinNumberPos = { + x: schPort.center.x, + y: schPort.center.y, + } + + if (!schPort.side_of_component) return [] + const vecToEdge = getUnitVectorFromOutsideToEdge(schPort.side_of_component) + console.log(schPort.pin_number, schPort.side_of_component, vecToEdge) + + const realPinEdgeDistance = 0.2 + + // Move the pin number halfway to the edge of the box component so it sits + // between the edge and the port, exactly in the middle + realPinNumberPos.x += (vecToEdge.x * realPinEdgeDistance) / 2 + realPinNumberPos.y += (vecToEdge.y * realPinEdgeDistance) / 2 + + // Transform the pin position from local to global coordinates + const screenPinNumberTextPos = applyToPoint(transform, realPinNumberPos) + // Move the pin number text up a bit so it doesn't hit the port line + screenPinNumberTextPos.y -= 4 //px + + svgObjects.push({ + name: "text", + type: "element", + attributes: { + class: "pin-number", + x: screenPinNumberTextPos.x.toString(), + y: screenPinNumberTextPos.y.toString(), + style: "font-family: sans-serif;", + fill: colorMap.schematic.pin_number, + "text-anchor": "middle", + "dominant-baseline": dominantBaseline, + "font-size": "11px", + transform: + schPort.side_of_component === "top" || + schPort.side_of_component === "bottom" + ? `rotate(90deg, ${screenPinNumberTextPos.x}, ${screenPinNumberTextPos.y})` + : "", + }, + children: [ + { + type: "text", + value: schPort.pin_number?.toString() || "", + name: "", + attributes: {}, + children: [], + }, + ], + value: "", + }) + + return svgObjects +} diff --git a/lib/sch/svg-object-fns/create-svg-objects-from-sch-component-with-box.ts b/lib/sch/svg-object-fns/create-svg-objects-from-sch-component-with-box.ts index 72510f0..ec72d51 100644 --- a/lib/sch/svg-object-fns/create-svg-objects-from-sch-component-with-box.ts +++ b/lib/sch/svg-object-fns/create-svg-objects-from-sch-component-with-box.ts @@ -11,6 +11,7 @@ import { getSvg, symbols } from "schematic-symbols" import { parseSync } from "svgson" import { applyToPoint, type Matrix } from "transformation-matrix" import { createSvgObjectsFromSchematicComponentWithSymbol } from "./create-svg-objects-from-sch-component-with-symbol" +import { createSvgObjectsFromSchPortOnBox } from "./create-svg-objects-from-sch-port-on-box" export const createSvgObjectsFromSchematicComponentWithBox = ({ component: schComponent, @@ -26,11 +27,18 @@ export const createSvgObjectsFromSchematicComponentWithBox = ({ ) const svgObjects: SvgObject[] = [] - const componentScreenCenter = applyToPoint(transform, schComponent.center) - const componentScreenSize = applyToPoint(transform, { - x: schComponent.size.width, - y: schComponent.size.height, + const componentScreenTopLeft = applyToPoint(transform, { + x: schComponent.center.x - schComponent.size.width / 2, + y: schComponent.center.y + schComponent.size.height / 2, }) + const componentScreenBottomRight = applyToPoint(transform, { + x: schComponent.center.x + schComponent.size.width / 2, + y: schComponent.center.y - schComponent.size.height / 2, + }) + const componentScreenWidth = + componentScreenBottomRight.x - componentScreenTopLeft.x + const componentScreenHeight = + componentScreenBottomRight.y - componentScreenTopLeft.y // Add basic rectangle for component body svgObjects.push({ @@ -39,19 +47,15 @@ export const createSvgObjectsFromSchematicComponentWithBox = ({ value: "", attributes: { class: "component chip", - x: (componentScreenCenter.x - componentScreenSize.x / 2).toString(), - y: (componentScreenCenter.y - componentScreenSize.y / 2).toString(), - width: componentScreenSize.x.toString(), - height: componentScreenSize.y.toString(), - "stroke-width": "0.02", + x: componentScreenTopLeft.x.toString(), + y: componentScreenTopLeft.y.toString(), + width: componentScreenWidth.toString(), + height: componentScreenHeight.toString(), + "stroke-width": "2px", }, children: [], }) - console.log(schComponent.center) - console.log(schComponent.size) - console.log(svgObjects[0]) - // // Add manufacturer number and component name text // if (manufacturerNumber) { // // Calculate position for top center of component @@ -118,192 +122,14 @@ export const createSvgObjectsFromSchematicComponentWithBox = ({ const pinCircleRadius = 0.05 for (const schPort of schematicPorts) { - const { x: portX, y: portY } = schPort.center - const srcPort = su(circuitJson as any).source_port.get( - schPort.source_port_id, + svgObjects.push( + ...createSvgObjectsFromSchPortOnBox({ + schPort, + schComponent, + transform, + circuitJson, + }), ) - const pinNumber = srcPort?.pin_number - const pinLineStartX = portX - schComponent.center.x - const pinLineStartY = portY - schComponent.center.y - - let pinLineEndX = pinLineStartX - let pinLineEndY = pinLineStartY - - switch (schPort.side_of_component) { - case "left": - pinLineEndX = pinLineStartX + pinLineLength - break - case "right": - pinLineEndX = pinLineStartX - pinLineLength - break - case "top": - pinLineEndY = pinLineStartY + pinLineLength - break - case "bottom": - pinLineEndY = pinLineStartY - pinLineLength - break - } - - // Add port line - svgObjects.push({ - name: "line", - type: "element", - attributes: { - class: "component-pin", - x1: pinLineStartX.toString(), - y1: pinLineStartY.toString(), - x2: pinLineEndX.toString(), - y2: pinLineEndY.toString(), - "stroke-width": "0.02", - }, - value: "", - children: [], - }) - - // Add port circle - svgObjects.push({ - name: "circle", - type: "element", - attributes: { - class: "component-pin", - cx: pinLineStartX.toString(), - cy: pinLineStartY.toString(), - r: pinCircleRadius.toString(), - "stroke-width": "0.02", - }, - value: "", - children: [], - }) - - // Transform port position for texts - const [portEndX, portEndY] = applyToPoint(transform, [ - schComponent.center.x + pinLineEndX, - schComponent.center.y + pinLineEndY, - ]) - - // Add port label - if ( - schComponent.port_labels && - `pin${pinNumber}` in schComponent.port_labels - ) { - const labelText = schComponent.port_labels[`pin${pinNumber}`]! - let labelX = portEndX - let labelY = portEndY - let textAnchor = "middle" - let rotation = 0 - const labelOffset = 0.1 // * componentScale - - switch (schPort.side_of_component) { - case "left": - labelX += labelOffset - textAnchor = "start" - break - case "right": - labelX -= labelOffset - textAnchor = "end" - break - case "top": - // For top ports, rotate text 90 degrees clockwise - labelY += labelOffset * 6 // Move label down inside the chip - textAnchor = "start" - rotation = -90 // Rotate clockwise - break - case "bottom": - // For bottom ports, rotate text 90 degrees counterclockwise - labelY -= labelOffset * 6 // Move label up inside the chip - textAnchor = "end" - rotation = -90 // Rotate counterclockwise - break - } - - svgObjects.push({ - name: "text", - type: "element", - attributes: { - class: "port-label", - x: labelX.toString(), - y: labelY.toString(), - "text-anchor": textAnchor, - "dominant-baseline": "middle", - "font-size": "14px", // (0.2 * componentScale).toString(), - transform: rotation - ? `rotate(${rotation}, ${labelX}, ${labelY})` - : "", - }, - children: [ - { - type: "text", - value: labelText, - name: "", - attributes: {}, - children: [], - }, - ], - value: "", - }) - } - - // Add pin number text - const pinNumberOffset = 0.2 - let localPinNumberTextX = portX - let localPinNumberTextY = portY - let dominantBaseline = "auto" - - switch (schPort.side_of_component) { - case "top": - // For top ports, stay at the same X but offset Y upward - localPinNumberTextY = portY - pinNumberOffset // Move above the circle - localPinNumberTextX = portX // Stay aligned with port - dominantBaseline = "auto" - break - case "bottom": - // For bottom ports, stay at the same X but offset Y downward - localPinNumberTextY = portY + pinNumberOffset - localPinNumberTextX = portX - dominantBaseline = "hanging" - break - case "left": - // For left ports, stay at the same Y but offset X - localPinNumberTextX = portX - pinNumberOffset - localPinNumberTextY = portY + pinNumberOffset / 4 - dominantBaseline = "auto" - break - case "right": - // For right ports, stay at the same Y but offset X - localPinNumberTextX = portX + pinNumberOffset - localPinNumberTextY = portY + pinNumberOffset / 4 - dominantBaseline = "auto" - break - } - - // Transform the pin position from local to global coordinates - const [screenPinNumberTextX, screenPinNumberTextY] = applyToPoint( - transform, - [localPinNumberTextX, localPinNumberTextY], - ) - - svgObjects.push({ - name: "text", - type: "element", - attributes: { - class: "pin-number", - x: screenPinNumberTextX.toString(), - y: screenPinNumberTextY.toString(), - "text-anchor": "middle", - "dominant-baseline": dominantBaseline, - "font-size": "14px", - }, - children: [ - { - type: "text", - value: pinNumber?.toString() || "", - name: "", - attributes: {}, - children: [], - }, - ], - value: "", - }) } // // Create component group with scaling diff --git a/lib/sch/svg-object-fns/create-svg-objects-from-sch-port-on-box.ts b/lib/sch/svg-object-fns/create-svg-objects-from-sch-port-on-box.ts new file mode 100644 index 0000000..50da081 --- /dev/null +++ b/lib/sch/svg-object-fns/create-svg-objects-from-sch-port-on-box.ts @@ -0,0 +1,153 @@ +import type { + AnyCircuitElement, + SchematicComponent, + SchematicPort, +} from "circuit-json" +import type { SvgObject } from "lib/svg-object" +import { applyToPoint, type Matrix } from "transformation-matrix" +import { su } from "@tscircuit/soup-util" +import { createSvgObjectsForSchPortBoxLine } from "./create-svg-objects-for-sch-port-box-line" +import { createSvgObjectsForSchPortPinNumberText } from "./create-svg-objects-for-sch-port-pin-number-text" + +export const createSvgObjectsFromSchPortOnBox = (params: { + schPort: SchematicPort + schComponent: SchematicComponent + transform: Matrix + circuitJson: AnyCircuitElement[] +}): SvgObject[] => { + const svgObjects: SvgObject[] = [] + const { schPort, schComponent, transform, circuitJson } = params + + svgObjects.push(...createSvgObjectsForSchPortBoxLine(params)) + svgObjects.push(...createSvgObjectsForSchPortPinNumberText(params)) + + // // Transform port position for texts + // const [portEndX, portEndY] = applyToPoint(transform, [ + // schComponent.center.x + pinLineEndX, + // schComponent.center.y + pinLineEndY, + // ]) + + // // Add port label + // if ( + // schComponent.port_labels && + // `pin${pinNumber}` in schComponent.port_labels + // ) { + // const labelText = schComponent.port_labels[`pin${pinNumber}`]! + // let labelX = portEndX + // let labelY = portEndY + // let textAnchor = "middle" + // let rotation = 0 + // const labelOffset = 0.1 // * componentScale + + // switch (schPort.side_of_component) { + // case "left": + // labelX += labelOffset + // textAnchor = "start" + // break + // case "right": + // labelX -= labelOffset + // textAnchor = "end" + // break + // case "top": + // // For top ports, rotate text 90 degrees clockwise + // labelY += labelOffset * 6 // Move label down inside the chip + // textAnchor = "start" + // rotation = -90 // Rotate clockwise + // break + // case "bottom": + // // For bottom ports, rotate text 90 degrees counterclockwise + // labelY -= labelOffset * 6 // Move label up inside the chip + // textAnchor = "end" + // rotation = -90 // Rotate counterclockwise + // break + // } + + // svgObjects.push({ + // name: "text", + // type: "element", + // attributes: { + // class: "port-label", + // x: labelX.toString(), + // y: labelY.toString(), + // "text-anchor": textAnchor, + // "dominant-baseline": "middle", + // "font-size": "14px", // (0.2 * componentScale).toString(), + // transform: rotation ? `rotate(${rotation}, ${labelX}, ${labelY})` : "", + // }, + // children: [ + // { + // type: "text", + // value: labelText, + // name: "", + // attributes: {}, + // children: [], + // }, + // ], + // value: "", + // }) + // } + + // // Add pin number text + // const pinNumberOffset = 0.2 + // let localPinNumberTextX = schPort.center.x + // let localPinNumberTextY = schPort.center.y + // let dominantBaseline = "auto" + + // switch (schPort.side_of_component) { + // case "top": + // // For top ports, stay at the same X but offset Y upward + // localPinNumberTextY = schPort.center.y - pinNumberOffset // Move above the circle + // localPinNumberTextX = schPort.center.x // Stay aligned with port + // dominantBaseline = "auto" + // break + // case "bottom": + // // For bottom ports, stay at the same X but offset Y downward + // localPinNumberTextY = schPort.center.y + pinNumberOffset + // localPinNumberTextX = schPort.center.x + // dominantBaseline = "hanging" + // break + // case "left": + // // For left ports, stay at the same Y but offset X + // localPinNumberTextX = schPort.center.x - pinNumberOffset + // localPinNumberTextY = schPort.center.y + pinNumberOffset / 4 + // dominantBaseline = "auto" + // break + // case "right": + // // For right ports, stay at the same Y but offset X + // localPinNumberTextX = schPort.center.x + pinNumberOffset + // localPinNumberTextY = schPort.center.y + pinNumberOffset / 4 + // dominantBaseline = "auto" + // break + // } + + // // Transform the pin position from local to global coordinates + // const [screenPinNumberTextX, screenPinNumberTextY] = applyToPoint(transform, [ + // localPinNumberTextX, + // localPinNumberTextY, + // ]) + + // svgObjects.push({ + // name: "text", + // type: "element", + // attributes: { + // class: "pin-number", + // x: screenPinNumberTextX.toString(), + // y: screenPinNumberTextY.toString(), + // "text-anchor": "middle", + // "dominant-baseline": dominantBaseline, + // "font-size": "14px", + // }, + // children: [ + // { + // type: "text", + // value: pinNumber?.toString() || "", + // name: "", + // attributes: {}, + // children: [], + // }, + // ], + // value: "", + // }) + + return svgObjects +} diff --git a/lib/utils/get-unit-vector-from-outside-to-edge.ts b/lib/utils/get-unit-vector-from-outside-to-edge.ts new file mode 100644 index 0000000..e7089d6 --- /dev/null +++ b/lib/utils/get-unit-vector-from-outside-to-edge.ts @@ -0,0 +1,21 @@ +/** + * Given a side, gives you the unit vector you would move in if you were coming + * towards that edge from the outside. This is the same as the unit vector from + * a port to the edge of a schematic box. This function assumes cartesian + * coordinates (Y positive is up) + */ +export const getUnitVectorFromOutsideToEdge = ( + side: "top" | "bottom" | "left" | "right", +) => { + switch (side) { + case "top": + return { x: 0, y: -1 } + case "bottom": + return { x: 0, y: 1 } + case "left": + return { x: 1, y: 0 } + case "right": + return { x: -1, y: 0 } + } + throw new Error(`Invalid side: ${side}`) +} diff --git a/tests/sch/__snapshots__/debug-object.snap.svg b/tests/sch/__snapshots__/debug-object.snap.svg index f4d5bd3..b92b5c3 100644 --- a/tests/sch/__snapshots__/debug-object.snap.svg +++ b/tests/sch/__snapshots__/debug-object.snap.svg @@ -9,4 +9,4 @@ .pin-number { font-size: 0.15px; fill: rgb(169, 0, 0); } .port-label { fill: rgb(0, 100, 100); } .component-name { font-size: 0.25px; fill: rgb(0, 100, 100); } - -1,-1-1,0-1,1-1,20,-10,00,10,21,-11,01,11,2Debug BoxDebug Line \ No newline at end of file + -1,-1-1,0-1,1-1,20,-10,00,10,21,-11,01,11,2Debug BoxDebug Line \ No newline at end of file diff --git a/tests/sch/__snapshots__/grid-and-points.snap.svg b/tests/sch/__snapshots__/grid-and-points.snap.svg index 1411715..93f1e99 100644 --- a/tests/sch/__snapshots__/grid-and-points.snap.svg +++ b/tests/sch/__snapshots__/grid-and-points.snap.svg @@ -9,4 +9,4 @@ .pin-number { font-size: 0.15px; fill: rgb(169, 0, 0); } .port-label { fill: rgb(0, 100, 100); } .component-name { font-size: 0.25px; fill: rgb(0, 100, 100); } - -1,-1-1,-0.5-1,0-1,0.5-1,1-0.5,-1-0.5,-0.5-0.5,0-0.5,0.5-0.5,10,-10,-0.50,00,0.50,10.5,-10.5,-0.50.5,00.5,0.50.5,11,-11,-0.51,01,0.51,1OriginPoint ATest Box \ No newline at end of file + -1,-1-1,-0.5-1,0-1,0.5-1,1-0.5,-1-0.5,-0.5-0.5,0-0.5,0.5-0.5,10,-10,-0.50,00,0.50,10.5,-10.5,-0.50.5,00.5,0.50.5,11,-11,-0.51,01,0.51,1OriginPoint ATest Box \ No newline at end of file diff --git a/tests/sch/__snapshots__/kicad-theme-demo.snap.svg b/tests/sch/__snapshots__/kicad-theme-demo.snap.svg index 2e5dd2d..b85e461 100644 --- a/tests/sch/__snapshots__/kicad-theme-demo.snap.svg +++ b/tests/sch/__snapshots__/kicad-theme-demo.snap.svg @@ -6,7 +6,7 @@ .component-pin { fill: none; stroke: rgb(132, 0, 0); } .trace { stroke: rgb(0, 150, 0); stroke-width: 2px; fill: none; } .text { font-family: Arial, sans-serif; font-size: 2px; fill: rgb(0, 150, 0); } - .pin-number { font-size: 0.15px; fill: rgb(169, 0, 0); } + .pin-number { fill: rgb(169, 0, 0); } .port-label { fill: rgb(0, 100, 100); } .component-name { font-size: 0.25px; fill: rgb(0, 100, 100); } - -2,-4-2,-3-2,-2-2,-1-2,0-2,1-2,2-2,3-2,4-1,-4-1,-3-1,-2-1,-1-1,0-1,1-1,2-1,3-1,40,-40,-30,-20,-10,00,10,20,30,41,-41,-31,-21,-11,01,11,21,31,42,-42,-32,-22,-12,02,12,22,32,43,-43,-33,-23,-13,03,13,23,33,44,-44,-34,-24,-14,04,14,24,34,45,-45,-35,-25,-15,05,15,25,35,46,-46,-36,-26,-16,06,16,26,36,47,-47,-37,-27,-17,07,17,27,37,4RESET297820192212GND1314151617234OSC1181VCC2 \ No newline at end of file + -2,-4-2,-3-2,-2-2,-1-2,0-2,1-2,2-2,3-2,4-1,-4-1,-3-1,-2-1,-1-1,0-1,1-1,2-1,3-1,40,-40,-30,-20,-10,00,10,20,30,41,-41,-31,-21,-11,01,11,21,31,42,-42,-32,-22,-12,02,12,22,32,43,-43,-33,-23,-13,03,13,23,33,44,-44,-34,-24,-14,04,14,24,34,45,-45,-35,-25,-15,05,15,25,35,46,-46,-36,-26,-16,06,16,26,36,47,-47,-37,-27,-17,07,17,27,37,429782019221213141516172341812 \ No newline at end of file