@tscircuit/core 0.0.971 → 0.0.972

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.
Files changed (2) hide show
  1. package/dist/index.js +16 -17
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -16559,24 +16559,23 @@ var Board = class extends Group6 {
16559
16559
  if (Math.abs(deltaX) < 1e-6 && Math.abs(deltaY) < 1e-6) {
16560
16560
  return;
16561
16561
  }
16562
- for (const child of this.children) {
16563
- if (child instanceof NormalComponent3) {
16564
- let childOldCenter;
16565
- if (child.pcb_component_id) {
16566
- const comp = db.pcb_component.get(child.pcb_component_id);
16567
- if (comp) childOldCenter = comp.center;
16568
- } else if (child instanceof Group6 && child.pcb_group_id) {
16569
- const group = db.pcb_group.get(child.pcb_group_id);
16570
- if (group) childOldCenter = group.center;
16571
- }
16572
- if (childOldCenter) {
16573
- child._repositionOnPcb({
16574
- x: childOldCenter.x + deltaX,
16575
- y: childOldCenter.y + deltaY
16562
+ for (const child of this.getDescendants()) {
16563
+ if (child.isPcbPrimitive && "_moveCircuitJsonElements" in child && typeof child._moveCircuitJsonElements === "function") {
16564
+ child._moveCircuitJsonElements({ deltaX, deltaY });
16565
+ }
16566
+ if (child instanceof Group6) {
16567
+ const groupChild = child;
16568
+ const pcbGroup = db.pcb_group.get(groupChild.pcb_group_id || "");
16569
+ if (!pcbGroup) continue;
16570
+ if (pcbGroup.center) {
16571
+ if (!groupChild.pcb_group_id) continue;
16572
+ db.pcb_group.update(groupChild.pcb_group_id, {
16573
+ center: {
16574
+ x: pcbGroup.center.x + deltaX,
16575
+ y: pcbGroup.center.y + deltaY
16576
+ }
16576
16577
  });
16577
16578
  }
16578
- } else if (child.isPcbPrimitive && "_moveCircuitJsonElements" in child && typeof child._moveCircuitJsonElements === "function") {
16579
- child._moveCircuitJsonElements({ deltaX, deltaY });
16580
16579
  }
16581
16580
  }
16582
16581
  if (this.pcb_board_id) {
@@ -20835,7 +20834,7 @@ import { identity as identity5 } from "transformation-matrix";
20835
20834
  var package_default = {
20836
20835
  name: "@tscircuit/core",
20837
20836
  type: "module",
20838
- version: "0.0.970",
20837
+ version: "0.0.971",
20839
20838
  types: "dist/index.d.ts",
20840
20839
  main: "dist/index.js",
20841
20840
  module: "dist/index.js",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.971",
4
+ "version": "0.0.972",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",