circuit-to-svg 0.0.188 → 0.0.189

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
@@ -425,10 +425,15 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
425
425
  ];
426
426
  }
427
427
  if (hole.shape === "circular_hole_with_rect_pad") {
428
+ const h = hole;
428
429
  const scaledHoleDiameter = hole.hole_diameter * Math.abs(transform.a);
429
430
  const scaledRectPadWidth = hole.rect_pad_width * Math.abs(transform.a);
430
431
  const scaledRectPadHeight = hole.rect_pad_height * Math.abs(transform.a);
431
432
  const holeRadius = scaledHoleDiameter / 2;
433
+ const [holeCx, holeCy] = applyToPoint4(transform, [
434
+ h.x + (h.hole_offset_x ?? 0),
435
+ h.y + (h.hole_offset_y ?? 0)
436
+ ]);
432
437
  return [
433
438
  {
434
439
  name: "g",
@@ -449,15 +454,15 @@ function createSvgObjectsFromPcbPlatedHole(hole, ctx) {
449
454
  value: "",
450
455
  children: []
451
456
  },
452
- // Circular hole inside the rectangle
457
+ // Circular hole inside the rectangle (with optional offset)
453
458
  {
454
459
  name: "circle",
455
460
  type: "element",
456
461
  attributes: {
457
462
  class: "pcb-hole-inner",
458
463
  fill: colorMap2.drill,
459
- cx: x.toString(),
460
- cy: y.toString(),
464
+ cx: holeCx.toString(),
465
+ cy: holeCy.toString(),
461
466
  r: holeRadius.toString()
462
467
  },
463
468
  value: "",
@@ -1644,7 +1649,7 @@ var package_default = {
1644
1649
  "react-cosmos": "7.0.0",
1645
1650
  "react-cosmos-plugin-vite": "7.0.0",
1646
1651
  "react-dom": "19.1.0",
1647
- tscircuit: "^0.0.624",
1652
+ tscircuit: "^0.0.632",
1648
1653
  tsup: "^8.0.2",
1649
1654
  typescript: "^5.4.5",
1650
1655
  "vite-tsconfig-paths": "^5.0.1"