@tscircuit/core 0.0.596 → 0.0.597
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 +11 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8180,6 +8180,7 @@ var Group_doInitialPcbLayoutPack = (group) => {
|
|
|
8180
8180
|
);
|
|
8181
8181
|
const subtree = buildSubtree2(db.toArray(), { source_group_id: componentId });
|
|
8182
8182
|
transformPCBElements2(subtree, transformMatrix);
|
|
8183
|
+
db.pcb_group.update(pcbGroup.pcb_group_id, { center });
|
|
8183
8184
|
}
|
|
8184
8185
|
};
|
|
8185
8186
|
|
|
@@ -8982,15 +8983,21 @@ var Board = class extends Group {
|
|
|
8982
8983
|
let maxX = -Infinity;
|
|
8983
8984
|
let maxY = -Infinity;
|
|
8984
8985
|
const allPcbComponents = db.pcb_component.list();
|
|
8986
|
+
const allPcbGroups = db.pcb_group.list();
|
|
8985
8987
|
let hasComponents = false;
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
if (width === 0 || height === 0) continue;
|
|
8988
|
+
const updateBounds = (center2, width, height) => {
|
|
8989
|
+
if (width === 0 || height === 0) return;
|
|
8989
8990
|
hasComponents = true;
|
|
8990
8991
|
minX = Math.min(minX, center2.x - width / 2);
|
|
8991
8992
|
minY = Math.min(minY, center2.y - height / 2);
|
|
8992
8993
|
maxX = Math.max(maxX, center2.x + width / 2);
|
|
8993
8994
|
maxY = Math.max(maxY, center2.y + height / 2);
|
|
8995
|
+
};
|
|
8996
|
+
for (const pcbComponent of allPcbComponents) {
|
|
8997
|
+
updateBounds(pcbComponent.center, pcbComponent.width, pcbComponent.height);
|
|
8998
|
+
}
|
|
8999
|
+
for (const pcbGroup of allPcbGroups) {
|
|
9000
|
+
updateBounds(pcbGroup.center, pcbGroup.width, pcbGroup.height);
|
|
8994
9001
|
}
|
|
8995
9002
|
const padding = 2;
|
|
8996
9003
|
const computedWidth = hasComponents ? maxX - minX + padding * 2 : 0;
|
|
@@ -11257,7 +11264,7 @@ import { identity as identity5 } from "transformation-matrix";
|
|
|
11257
11264
|
var package_default = {
|
|
11258
11265
|
name: "@tscircuit/core",
|
|
11259
11266
|
type: "module",
|
|
11260
|
-
version: "0.0.
|
|
11267
|
+
version: "0.0.596",
|
|
11261
11268
|
types: "dist/index.d.ts",
|
|
11262
11269
|
main: "dist/index.js",
|
|
11263
11270
|
module: "dist/index.js",
|