@tscircuit/core 0.0.1058 → 0.0.1059

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 +11 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -8387,29 +8387,19 @@ var Port = class extends PrimitiveComponent2 {
8387
8387
  if (this.schematic_stem_line_id) {
8388
8388
  const line = db.schematic_line.get(this.schematic_stem_line_id);
8389
8389
  if (line) {
8390
- const originalStemLength = Math.sqrt(
8391
- (line.x1 - line.x2) ** 2 + (line.y1 - line.y2) ** 2
8392
- );
8393
- const anchorScaled = applyToPoint14(transform, {
8394
- x: line.x2,
8395
- y: line.y2
8396
- });
8397
- const { direction } = this._parsedProps;
8398
- let outerX = anchorScaled.x;
8399
- let outerY = anchorScaled.y;
8400
- if (direction === "right") outerX += originalStemLength;
8401
- else if (direction === "left") outerX -= originalStemLength;
8402
- else if (direction === "up") outerY += originalStemLength;
8403
- else if (direction === "down") outerY -= originalStemLength;
8390
+ const p1 = applyToPoint14(transform, { x: line.x1, y: line.y1 });
8391
+ const p2 = applyToPoint14(transform, { x: line.x2, y: line.y2 });
8404
8392
  db.schematic_line.update(this.schematic_stem_line_id, {
8405
- x1: outerX,
8406
- y1: outerY,
8407
- x2: anchorScaled.x,
8408
- y2: anchorScaled.y
8393
+ x1: p1.x,
8394
+ y1: p1.y,
8395
+ x2: p2.x,
8396
+ y2: p2.y
8409
8397
  });
8398
+ const scaledStemLength = Math.sqrt(
8399
+ (p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2
8400
+ );
8410
8401
  db.schematic_port.update(this.schematic_port_id, {
8411
- center: { x: outerX, y: outerY },
8412
- distance_from_component_edge: originalStemLength
8402
+ distance_from_component_edge: scaledStemLength
8413
8403
  });
8414
8404
  }
8415
8405
  }
@@ -18095,7 +18085,7 @@ import { identity as identity4 } from "transformation-matrix";
18095
18085
  var package_default = {
18096
18086
  name: "@tscircuit/core",
18097
18087
  type: "module",
18098
- version: "0.0.1057",
18088
+ version: "0.0.1058",
18099
18089
  types: "dist/index.d.ts",
18100
18090
  main: "dist/index.js",
18101
18091
  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.1058",
4
+ "version": "0.0.1059",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",