@tscircuit/core 0.0.541 → 0.0.542

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 +20 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -7330,10 +7330,15 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
7330
7330
  centerPinColors: ["netlabel_center", "component_center"],
7331
7331
  corpus
7332
7332
  });
7333
+ const groupOffset = group._getGlobalSchematicPositionBeforeLayout();
7333
7334
  for (const box of laidOutBpcGraph.boxes) {
7334
7335
  if (!box.center) continue;
7335
7336
  const schematic_component2 = db.schematic_component.get(box.boxId);
7336
7337
  if (schematic_component2) {
7338
+ const newCenter = {
7339
+ x: box.center.x + groupOffset.x,
7340
+ y: box.center.y + groupOffset.y
7341
+ };
7337
7342
  const ports = db.schematic_port.list({
7338
7343
  schematic_component_id: schematic_component2.schematic_component_id
7339
7344
  });
@@ -7341,8 +7346,8 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
7341
7346
  schematic_component_id: schematic_component2.schematic_component_id
7342
7347
  });
7343
7348
  const positionDelta = {
7344
- x: schematic_component2.center.x - box.center.x,
7345
- y: schematic_component2.center.y - box.center.y
7349
+ x: newCenter.x - schematic_component2.center.x,
7350
+ y: newCenter.y - schematic_component2.center.y
7346
7351
  };
7347
7352
  for (const port of ports) {
7348
7353
  port.center.x += positionDelta.x;
@@ -7352,8 +7357,7 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
7352
7357
  text.position.x += positionDelta.x;
7353
7358
  text.position.y += positionDelta.y;
7354
7359
  }
7355
- schematic_component2.center.x += positionDelta.x;
7356
- schematic_component2.center.y += positionDelta.y;
7360
+ schematic_component2.center = newCenter;
7357
7361
  continue;
7358
7362
  }
7359
7363
  const schematic_net_label = db.schematic_net_label.get(box.boxId);
@@ -7364,10 +7368,14 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
7364
7368
  if (!pin) {
7365
7369
  throw new Error(`No pin found for net label: ${box.boxId}`);
7366
7370
  }
7367
- schematic_net_label.center = box.center;
7371
+ const finalCenter = {
7372
+ x: box.center.x + groupOffset.x,
7373
+ y: box.center.y + groupOffset.y
7374
+ };
7375
+ schematic_net_label.center = finalCenter;
7368
7376
  schematic_net_label.anchor_position = {
7369
- x: box.center.x + pin.offset.x,
7370
- y: box.center.y + pin.offset.y
7377
+ x: finalCenter.x + pin.offset.x,
7378
+ y: finalCenter.y + pin.offset.y
7371
7379
  };
7372
7380
  continue;
7373
7381
  }
@@ -7386,12 +7394,12 @@ function Group_doInitialSchematicLayoutMatchAdapt(group) {
7386
7394
  text: source_net.name,
7387
7395
  // no text; just a placeholder box for Match-Adapt
7388
7396
  anchor_position: {
7389
- x: box.center.x + center.offset.x,
7390
- y: box.center.y + center.offset.y
7397
+ x: box.center.x + groupOffset.x + center.offset.x,
7398
+ y: box.center.y + groupOffset.y + center.offset.y
7391
7399
  },
7392
7400
  center: {
7393
- x: box.center.x + center.offset.x,
7394
- y: box.center.y + center.offset.y
7401
+ x: box.center.x + groupOffset.x + center.offset.x,
7402
+ y: box.center.y + groupOffset.y + center.offset.y
7395
7403
  },
7396
7404
  anchor_side: anchorSide,
7397
7405
  symbol_name: symbolName,
@@ -10670,7 +10678,7 @@ import { identity as identity4 } from "transformation-matrix";
10670
10678
  var package_default = {
10671
10679
  name: "@tscircuit/core",
10672
10680
  type: "module",
10673
- version: "0.0.540",
10681
+ version: "0.0.541",
10674
10682
  types: "dist/index.d.ts",
10675
10683
  main: "dist/index.js",
10676
10684
  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.541",
4
+ "version": "0.0.542",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",