@tscircuit/pcb-viewer 1.11.262 → 1.11.264

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 CHANGED
@@ -8154,9 +8154,11 @@ var convertElementToPrimitives = (element, allElements) => {
8154
8154
  ];
8155
8155
  }
8156
8156
  case "pcb_cutout": {
8157
- const cutoutElement = element;
8158
- switch (cutoutElement.shape) {
8157
+ switch (element.shape) {
8159
8158
  case "rect": {
8159
+ const cutoutElement = element;
8160
+ const corner_radius = cutoutElement.corner_radius;
8161
+ const ccw_rotation = cutoutElement.rotation ?? cutoutElement.rotation;
8160
8162
  return [
8161
8163
  {
8162
8164
  _pcb_drawing_object_id: getNewPcbDrawingObjectId("pcb_cutout_rect"),
@@ -8166,6 +8168,8 @@ var convertElementToPrimitives = (element, allElements) => {
8166
8168
  w: cutoutElement.width,
8167
8169
  h: cutoutElement.height,
8168
8170
  layer: "drill",
8171
+ roundness: corner_radius,
8172
+ ccw_rotation,
8169
8173
  _element: element,
8170
8174
  _parent_pcb_component,
8171
8175
  _parent_source_component
@@ -8173,6 +8177,7 @@ var convertElementToPrimitives = (element, allElements) => {
8173
8177
  ];
8174
8178
  }
8175
8179
  case "circle": {
8180
+ const cutoutElement = element;
8176
8181
  return [
8177
8182
  {
8178
8183
  _pcb_drawing_object_id: getNewPcbDrawingObjectId("pcb_cutout_circle"),
@@ -8188,6 +8193,7 @@ var convertElementToPrimitives = (element, allElements) => {
8188
8193
  ];
8189
8194
  }
8190
8195
  case "polygon": {
8196
+ const cutoutElement = element;
8191
8197
  return [
8192
8198
  {
8193
8199
  _pcb_drawing_object_id: getNewPcbDrawingObjectId("pcb_cutout_polygon"),
@@ -8201,7 +8207,7 @@ var convertElementToPrimitives = (element, allElements) => {
8201
8207
  ];
8202
8208
  }
8203
8209
  default:
8204
- console.warn(`Unsupported pcb_cutout shape: ${cutoutElement.shape}`);
8210
+ console.warn(`Unsupported pcb_cutout shape: ${element.shape}`);
8205
8211
  return [];
8206
8212
  }
8207
8213
  }
@@ -12324,6 +12330,9 @@ var getPrimitivesUnderPoint = (primitives, rwPoint, transform) => {
12324
12330
  } else if ("r" in primitive) {
12325
12331
  w = primitive.r * 2;
12326
12332
  h = primitive.r * 2;
12333
+ } else if ("rX" in primitive && "rY" in primitive) {
12334
+ w = primitive.rX * 2;
12335
+ h = primitive.rY * 2;
12327
12336
  } else {
12328
12337
  continue;
12329
12338
  }
@@ -12369,8 +12378,8 @@ var MouseElementTracker = ({
12369
12378
  h = boundingBox.height;
12370
12379
  } else if ("x" in primitive && "y" in primitive) {
12371
12380
  basePoint = { x: primitive.x, y: primitive.y };
12372
- w = "w" in primitive ? primitive.w : "r" in primitive ? primitive.r * 2 : 0;
12373
- h = "h" in primitive ? primitive.h : "r" in primitive ? primitive.r * 2 : 0;
12381
+ w = "w" in primitive ? primitive.w : "r" in primitive ? primitive.r * 2 : "rX" in primitive && "rY" in primitive ? primitive.rX * 2 : 0;
12382
+ h = "h" in primitive ? primitive.h : "r" in primitive ? primitive.r * 2 : "rX" in primitive && "rY" in primitive ? primitive.rY * 2 : 0;
12374
12383
  }
12375
12384
  if (!basePoint) continue;
12376
12385
  const screenPos = applyToPoint12(transform, basePoint);
@@ -12819,7 +12828,7 @@ import { css as css3 } from "@emotion/css";
12819
12828
  // package.json
12820
12829
  var package_default = {
12821
12830
  name: "@tscircuit/pcb-viewer",
12822
- version: "1.11.261",
12831
+ version: "1.11.263",
12823
12832
  main: "dist/index.js",
12824
12833
  type: "module",
12825
12834
  repository: "tscircuit/pcb-viewer",
@@ -12871,7 +12880,7 @@ var package_default = {
12871
12880
  "@emotion/css": "^11.11.2",
12872
12881
  "@tscircuit/alphabet": "^0.0.3",
12873
12882
  "@vitejs/plugin-react": "^5.0.2",
12874
- "circuit-json": "^0.0.307",
12883
+ "circuit-json": "^0.0.317",
12875
12884
  "circuit-to-svg": "^0.0.271",
12876
12885
  color: "^4.2.3",
12877
12886
  "react-supergrid": "^1.0.10",