@tscircuit/core 0.0.248 → 0.0.249

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 +6 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2916,8 +2916,9 @@ var NormalComponent = class extends PrimitiveComponent {
2916
2916
  primaryPortLabels[port] = Array.isArray(label) ? label[0] : label;
2917
2917
  }
2918
2918
  }
2919
+ const center = this._getGlobalSchematicPositionBeforeLayout();
2919
2920
  const schematic_component2 = db.schematic_component.insert({
2920
- center: { x: props.schX ?? 0, y: props.schY ?? 0 },
2921
+ center,
2921
2922
  rotation: props.schRotation ?? 0,
2922
2923
  size: dimensions.getSize(),
2923
2924
  port_arrangement: underscorifyPortArrangement(
@@ -2938,8 +2939,8 @@ var NormalComponent = class extends PrimitiveComponent {
2938
2939
  anchor: "left",
2939
2940
  rotation: 0,
2940
2941
  position: {
2941
- x: hasTopOrBottomPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 + 0.1 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
2942
- y: hasTopOrBottomPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.35 : (props.schY ?? 0) - (schematic_box_height ?? 0) / 2 - 0.13
2942
+ x: hasTopOrBottomPins ? center.x + (schematic_box_width ?? 0) / 2 + 0.1 : center.x - (schematic_box_width ?? 0) / 2,
2943
+ y: hasTopOrBottomPins ? center.y + (schematic_box_height ?? 0) / 2 + 0.35 : center.y - (schematic_box_height ?? 0) / 2 - 0.13
2943
2944
  },
2944
2945
  color: "#006464"
2945
2946
  });
@@ -2949,8 +2950,8 @@ var NormalComponent = class extends PrimitiveComponent {
2949
2950
  anchor: "left",
2950
2951
  rotation: 0,
2951
2952
  position: {
2952
- x: hasTopOrBottomPins ? (props.schX ?? 0) + (schematic_box_width ?? 0) / 2 + 0.1 : (props.schX ?? 0) - (schematic_box_width ?? 0) / 2,
2953
- y: hasTopOrBottomPins ? (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.55 : (props.schY ?? 0) + (schematic_box_height ?? 0) / 2 + 0.13
2953
+ x: hasTopOrBottomPins ? center.x + (schematic_box_width ?? 0) / 2 + 0.1 : center.x - (schematic_box_width ?? 0) / 2,
2954
+ y: hasTopOrBottomPins ? center.y + (schematic_box_height ?? 0) / 2 + 0.55 : center.y + (schematic_box_height ?? 0) / 2 + 0.13
2954
2955
  },
2955
2956
  color: "#006464"
2956
2957
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.248",
4
+ "version": "0.0.249",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",