@tscircuit/core 0.0.401 → 0.0.402

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 -7
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1850,10 +1850,18 @@ var PcbTrace = class extends PrimitiveComponent2 {
1850
1850
  const { _parsedProps: props } = this;
1851
1851
  const container = this.getPrimitiveContainer();
1852
1852
  const subcircuit = this.getSubcircuit();
1853
- const parentTransform = container._computePcbGlobalTransformBeforeLayout();
1853
+ const { maybeFlipLayer } = this._getPcbPrimitiveFlippedHelpers();
1854
+ const parentTransform = this._computePcbGlobalTransformBeforeLayout();
1854
1855
  const transformedRoute = props.route.map((point) => {
1855
1856
  const { x, y, ...restOfPoint } = point;
1856
1857
  const transformedPoint = applyToPoint3(parentTransform, { x, y });
1858
+ if (point.route_type === "wire" && point.layer) {
1859
+ return {
1860
+ ...transformedPoint,
1861
+ ...restOfPoint,
1862
+ layer: maybeFlipLayer(point.layer)
1863
+ };
1864
+ }
1857
1865
  return { ...transformedPoint, ...restOfPoint };
1858
1866
  });
1859
1867
  const pcb_trace = db.pcb_trace.insert({
@@ -2394,7 +2402,7 @@ function getRelativeDirection(pointA, pointB) {
2394
2402
 
2395
2403
  // lib/components/primitive-components/Port/Port.ts
2396
2404
  import "schematic-symbols";
2397
- import { applyToPoint as applyToPoint4, compose as compose2, translate as translate2 } from "transformation-matrix";
2405
+ import { applyToPoint as applyToPoint4, compose as compose3, translate as translate3 } from "transformation-matrix";
2398
2406
  import { z as z5 } from "zod";
2399
2407
 
2400
2408
  // lib/components/primitive-components/Port/areAllPcbPrimitivesOverlapping.ts
@@ -2563,9 +2571,9 @@ var Port = class extends PrimitiveComponent2 {
2563
2571
  );
2564
2572
  }
2565
2573
  }
2566
- const transform = compose2(
2574
+ const transform = compose3(
2567
2575
  this.parent.computeSchematicGlobalTransform(),
2568
- translate2(-symbol.center.x, -symbol.center.y)
2576
+ translate3(-symbol.center.x, -symbol.center.y)
2569
2577
  );
2570
2578
  return applyToPoint4(transform, schematicSymbolPortDef);
2571
2579
  }
@@ -6009,7 +6017,7 @@ var applyEditEventsToManualEditsFile = ({
6009
6017
 
6010
6018
  // lib/utils/edit-events/apply-edit-events-to-circuit-json.ts
6011
6019
  import { transformPCBElement } from "@tscircuit/circuit-json-util";
6012
- import { translate as translate3 } from "transformation-matrix";
6020
+ import { translate as translate4 } from "transformation-matrix";
6013
6021
 
6014
6022
  // lib/utils/edit-events/apply-trace-hint-edit-event.ts
6015
6023
  import { su as su3 } from "@tscircuit/circuit-json-util";
@@ -6054,7 +6062,7 @@ var applyEditEvents = ({
6054
6062
  );
6055
6063
  const needsMovement = !component || component.center.x !== editEvent.new_center.x || component.center.y !== editEvent.new_center.y;
6056
6064
  if (needsMovement && editEvent.original_center) {
6057
- const mat = translate3(
6065
+ const mat = translate4(
6058
6066
  editEvent.new_center.x - editEvent.original_center.x,
6059
6067
  editEvent.new_center.y - editEvent.original_center.y
6060
6068
  );
@@ -8166,7 +8174,7 @@ import { identity as identity4 } from "transformation-matrix";
8166
8174
  var package_default = {
8167
8175
  name: "@tscircuit/core",
8168
8176
  type: "module",
8169
- version: "0.0.400",
8177
+ version: "0.0.401",
8170
8178
  types: "dist/index.d.ts",
8171
8179
  main: "dist/index.js",
8172
8180
  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.401",
4
+ "version": "0.0.402",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",