circuit-to-svg 0.0.192 → 0.0.193

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -345,6 +345,9 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
345
345
  const innerRadiusX = scaledHoleWidth / 2;
346
346
  const innerRadiusY = scaledHoleHeight / 2;
347
347
  const straightLength = scaledOuterHeight - scaledOuterWidth;
348
+ const rotation = hole.ccw_rotation || 0;
349
+ const outerTransform = rotation ? `translate(${x} ${y}) rotate(${-rotation})` : `translate(${x} ${y})`;
350
+ const innerTransform = rotation ? `translate(${x} ${y}) rotate(${-rotation})` : `translate(${x} ${y})`;
348
351
  return [
349
352
  {
350
353
  name: "g",
@@ -357,7 +360,8 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
357
360
  attributes: {
358
361
  class: "pcb-hole-outer",
359
362
  fill: colorMap2.copper.top,
360
- d: `M${x - outerRadiusX},${y - straightLength / 2} v${straightLength} a${outerRadiusX},${outerRadiusX} 0 0 0 ${scaledOuterWidth},0 v-${straightLength} a${outerRadiusX},${outerRadiusX} 0 0 0 -${scaledOuterWidth},0 z`
363
+ d: `M${-outerRadiusX},${-straightLength / 2} v${straightLength} a${outerRadiusX},${outerRadiusX} 0 0 0 ${scaledOuterWidth},0 v-${straightLength} a${outerRadiusX},${outerRadiusX} 0 0 0 -${scaledOuterWidth},0 z`,
364
+ transform: outerTransform
361
365
  },
362
366
  value: "",
363
367
  children: []
@@ -369,7 +373,8 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
369
373
  attributes: {
370
374
  class: "pcb-hole-inner",
371
375
  fill: colorMap2.drill,
372
- d: `M${x - innerRadiusX},${y - (scaledHoleHeight - scaledHoleWidth) / 2} v${scaledHoleHeight - scaledHoleWidth} a${innerRadiusX},${innerRadiusX} 0 0 0 ${scaledHoleWidth},0 v-${scaledHoleHeight - scaledHoleWidth} a${innerRadiusX},${innerRadiusX} 0 0 0 -${scaledHoleWidth},0 z`
376
+ d: `M${-innerRadiusX},${-(scaledHoleHeight - scaledHoleWidth) / 2} v${scaledHoleHeight - scaledHoleWidth} a${innerRadiusX},${innerRadiusX} 0 0 0 ${scaledHoleWidth},0 v-${scaledHoleHeight - scaledHoleWidth} a${innerRadiusX},${innerRadiusX} 0 0 0 -${scaledHoleWidth},0 z`,
377
+ transform: innerTransform
373
378
  },
374
379
  value: "",
375
380
  children: []
@@ -1645,7 +1650,7 @@ function getSoftwareUsedString(circuitJson) {
1645
1650
  var package_default = {
1646
1651
  name: "circuit-to-svg",
1647
1652
  type: "module",
1648
- version: "0.0.191",
1653
+ version: "0.0.192",
1649
1654
  description: "Convert Circuit JSON to SVG",
1650
1655
  main: "dist/index.js",
1651
1656
  files: [
@@ -1673,7 +1678,7 @@ var package_default = {
1673
1678
  "react-cosmos": "7.0.0",
1674
1679
  "react-cosmos-plugin-vite": "7.0.0",
1675
1680
  "react-dom": "19.1.0",
1676
- tscircuit: "^0.0.632",
1681
+ tscircuit: "^0.0.648",
1677
1682
  tsup: "^8.0.2",
1678
1683
  typescript: "^5.4.5",
1679
1684
  "vite-tsconfig-paths": "^5.0.1"