@tscircuit/core 0.0.410 → 0.0.411

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 +33 -31
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -3741,43 +3741,45 @@ var createDownwardNetLabelGroundSymbol = ({
3741
3741
  source_trace_id
3742
3742
  }, { db }) => {
3743
3743
  const offsets = calculateOffsets(port);
3744
+ const isLeftOrRight = port.facingDirection === "left" || port.facingDirection === "right";
3745
+ const horizontalEndPos = {
3746
+ x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
3747
+ y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
3748
+ };
3749
+ const groundSymbolPos = isLeftOrRight ? {
3750
+ x: horizontalEndPos.x,
3751
+ y: horizontalEndPos.y - 0.5
3752
+ } : horizontalEndPos;
3744
3753
  db.schematic_net_label.insert({
3745
3754
  anchor_side: "top",
3746
- center: {
3747
- x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
3748
- y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
3749
- },
3755
+ center: groundSymbolPos,
3750
3756
  source_net_id: port.source_port_id,
3751
3757
  text: schDisplayLabel,
3752
- anchor_position: {
3753
- x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
3754
- y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
3755
- },
3758
+ anchor_position: groundSymbolPos,
3756
3759
  symbol_name: "ground_horz"
3757
3760
  });
3758
- db.schematic_trace.insert({
3759
- edges: [
3760
- {
3761
- from: { x: anchorPos.x, y: anchorPos.y },
3762
- to: {
3763
- x: anchorPos.x,
3764
- y: anchorPos.y + offsets.handleUp * offsets.schBoxVertOffset
3765
- }
3766
- },
3767
- {
3768
- from: { x: anchorPos.x, y: anchorPos.y },
3769
- to: {
3770
- x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
3771
- y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
3772
- }
3773
- }
3774
- ],
3775
- junctions: [
3776
- {
3777
- x: anchorPos.x + offsets.horzPortDirection * offsets.schBoxHorzOffset,
3778
- y: anchorPos.y + offsets.vertPortDirectionOffset * offsets.schBoxVertOffset
3761
+ const edges = [
3762
+ {
3763
+ from: { x: anchorPos.x, y: anchorPos.y },
3764
+ to: {
3765
+ x: anchorPos.x,
3766
+ y: anchorPos.y + offsets.handleUp * offsets.schBoxVertOffset
3779
3767
  }
3780
- ],
3768
+ },
3769
+ {
3770
+ from: { x: anchorPos.x, y: anchorPos.y },
3771
+ to: horizontalEndPos
3772
+ }
3773
+ ];
3774
+ if (isLeftOrRight) {
3775
+ edges.push({
3776
+ from: horizontalEndPos,
3777
+ to: groundSymbolPos
3778
+ });
3779
+ }
3780
+ db.schematic_trace.insert({
3781
+ edges,
3782
+ junctions: [],
3781
3783
  source_trace_id
3782
3784
  });
3783
3785
  };
@@ -8255,7 +8257,7 @@ import { identity as identity4 } from "transformation-matrix";
8255
8257
  var package_default = {
8256
8258
  name: "@tscircuit/core",
8257
8259
  type: "module",
8258
- version: "0.0.409",
8260
+ version: "0.0.410",
8259
8261
  types: "dist/index.d.ts",
8260
8262
  main: "dist/index.js",
8261
8263
  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.410",
4
+ "version": "0.0.411",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",