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