@tscircuit/footprinter 0.0.230 → 0.0.231

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
@@ -7270,12 +7270,22 @@ var applyOrigin = (elements, origin) => {
7270
7270
  break;
7271
7271
  }
7272
7272
  if (dx === 0 && dy === 0) return elements;
7273
- for (const pad2 of pads) {
7274
- pad2.x -= dx;
7275
- pad2.y -= dy;
7276
- if (pad2.center) {
7277
- pad2.center.x -= dx;
7278
- pad2.center.y -= dy;
7273
+ for (const el of elements) {
7274
+ if (typeof el.x === "number") el.x -= dx;
7275
+ if (typeof el.y === "number") el.y -= dy;
7276
+ if (el.center && typeof el.center.x === "number") {
7277
+ el.center.x -= dx;
7278
+ el.center.y -= dy;
7279
+ }
7280
+ if (el.type === "pcb_silkscreen_path") {
7281
+ for (const pt of el.route) {
7282
+ pt.x -= dx;
7283
+ pt.y -= dy;
7284
+ }
7285
+ }
7286
+ if (el.type === "pcb_silkscreen_text" && el.anchor_position) {
7287
+ el.anchor_position.x -= dx;
7288
+ el.anchor_position.y -= dy;
7279
7289
  }
7280
7290
  }
7281
7291
  return elements;