@tscircuit/core 0.0.1396 → 0.0.1398

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 +15 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -20107,10 +20107,15 @@ function createSchematicTraceSolverInputProblem(group) {
20107
20107
  sourceNet.name || sourceNet.source_net_id || connKey
20108
20108
  );
20109
20109
  userNetIdToConnKey.set(userNetId, connKey);
20110
- const netLabelWidth = Number(
20110
+ const netLabelTextWidth = Number(
20111
20111
  getSchematicNetLabelTextWidth({ text: String(userNetId) }).toFixed(2)
20112
20112
  );
20113
- const netLabelHeight = sourceNet.is_ground || sourceNet.is_power ? SCHEMATIC_RAIL_NET_LABEL_HEIGHT : void 0;
20113
+ let netLabelWidth = netLabelTextWidth;
20114
+ let netLabelHeight;
20115
+ if (sourceNet.is_ground || sourceNet.is_power) {
20116
+ netLabelWidth = SCHEMATIC_RAIL_NET_LABEL_HEIGHT;
20117
+ netLabelHeight = netLabelTextWidth;
20118
+ }
20114
20119
  netConnections.push({
20115
20120
  netId: userNetId,
20116
20121
  pinIds: schematicPortIds.map(
@@ -20939,7 +20944,6 @@ function applyNetLabelPlacements(args) {
20939
20944
  debug9(`processing placement: ${placement.netId}`);
20940
20945
  const placementUserNetId = globalConnMap.getIdsConnectedToNet(placement.globalConnNetId).find((id) => userNetIdToConnKey.get(id));
20941
20946
  const placementConnKey = userNetIdToConnKey.get(placementUserNetId);
20942
- const anchor_position = placement.anchorPoint;
20943
20947
  const orientation = placement.orientation;
20944
20948
  const anchor_side = oppositeSide(orientation);
20945
20949
  let sourceNet;
@@ -20949,6 +20953,13 @@ function applyNetLabelPlacements(args) {
20949
20953
  const schPortIds = placement.pinIds.map(
20950
20954
  (pinId) => pinIdToSchematicPortId.get(pinId)
20951
20955
  );
20956
+ let anchor_position = placement.anchorPoint;
20957
+ if (schPortIds.length === 1 && schPortIds[0]) {
20958
+ const anchorSchPort = db.schematic_port.get(schPortIds[0]);
20959
+ if (anchorSchPort?.center && !anchorSchPort.is_connected) {
20960
+ anchor_position = anchorSchPort.center;
20961
+ }
20962
+ }
20952
20963
  if (schPortIds.some(
20953
20964
  (schPortId) => schematicPortIdsWithPreExistingNetLabels.has(schPortId)
20954
20965
  )) {
@@ -25281,7 +25292,7 @@ import { identity as identity5 } from "transformation-matrix";
25281
25292
  var package_default = {
25282
25293
  name: "@tscircuit/core",
25283
25294
  type: "module",
25284
- version: "0.0.1395",
25295
+ version: "0.0.1397",
25285
25296
  types: "dist/index.d.ts",
25286
25297
  main: "dist/index.js",
25287
25298
  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.1396",
4
+ "version": "0.0.1398",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",