@tscircuit/pcb-viewer 1.11.263 → 1.11.265
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 +43 -21
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7913,27 +7913,46 @@ var convertElementToPrimitives = (element, allElements) => {
|
|
|
7913
7913
|
let layer;
|
|
7914
7914
|
if (type === "pcb_silkscreen_path") {
|
|
7915
7915
|
layer = element.layer === "bottom" ? "bottom_silkscreen" : "top_silkscreen";
|
|
7916
|
+
return route.slice(0, -1).map((point, index) => {
|
|
7917
|
+
const nextPoint = route[index + 1];
|
|
7918
|
+
return {
|
|
7919
|
+
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7920
|
+
pcb_drawing_type: "line",
|
|
7921
|
+
x1: point.x,
|
|
7922
|
+
y1: point.y,
|
|
7923
|
+
x2: nextPoint.x,
|
|
7924
|
+
y2: nextPoint.y,
|
|
7925
|
+
width: element.stroke_width ?? 0.1,
|
|
7926
|
+
squareCap: false,
|
|
7927
|
+
layer,
|
|
7928
|
+
_element: element,
|
|
7929
|
+
_parent_pcb_component,
|
|
7930
|
+
_parent_source_component,
|
|
7931
|
+
_source_port
|
|
7932
|
+
};
|
|
7933
|
+
}).filter(Boolean);
|
|
7916
7934
|
} else if (type === "pcb_fabrication_note_path") {
|
|
7917
7935
|
layer = "top_fabrication";
|
|
7936
|
+
return route.slice(0, -1).map((point, index) => {
|
|
7937
|
+
const nextPoint = route[index + 1];
|
|
7938
|
+
return {
|
|
7939
|
+
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7940
|
+
pcb_drawing_type: "line",
|
|
7941
|
+
x1: point.x,
|
|
7942
|
+
y1: point.y,
|
|
7943
|
+
x2: nextPoint.x,
|
|
7944
|
+
y2: nextPoint.y,
|
|
7945
|
+
width: element.stroke_width ?? 0.1,
|
|
7946
|
+
squareCap: false,
|
|
7947
|
+
layer,
|
|
7948
|
+
color: element.color,
|
|
7949
|
+
_element: element,
|
|
7950
|
+
_parent_pcb_component,
|
|
7951
|
+
_parent_source_component,
|
|
7952
|
+
_source_port
|
|
7953
|
+
};
|
|
7954
|
+
}).filter(Boolean);
|
|
7918
7955
|
}
|
|
7919
|
-
return route.slice(0, -1).map((point, index) => {
|
|
7920
|
-
const nextPoint = route[index + 1];
|
|
7921
|
-
return {
|
|
7922
|
-
_pcb_drawing_object_id: `line_${globalPcbDrawingObjectCount++}`,
|
|
7923
|
-
pcb_drawing_type: "line",
|
|
7924
|
-
x1: point.x,
|
|
7925
|
-
y1: point.y,
|
|
7926
|
-
x2: nextPoint.x,
|
|
7927
|
-
y2: nextPoint.y,
|
|
7928
|
-
width: element.stroke_width ?? 0.1,
|
|
7929
|
-
squareCap: false,
|
|
7930
|
-
layer,
|
|
7931
|
-
_element: element,
|
|
7932
|
-
_parent_pcb_component,
|
|
7933
|
-
_parent_source_component,
|
|
7934
|
-
_source_port
|
|
7935
|
-
};
|
|
7936
|
-
}).filter(Boolean);
|
|
7937
7956
|
}
|
|
7938
7957
|
case "pcb_silkscreen_text": {
|
|
7939
7958
|
return [
|
|
@@ -12330,6 +12349,9 @@ var getPrimitivesUnderPoint = (primitives, rwPoint, transform) => {
|
|
|
12330
12349
|
} else if ("r" in primitive) {
|
|
12331
12350
|
w = primitive.r * 2;
|
|
12332
12351
|
h = primitive.r * 2;
|
|
12352
|
+
} else if ("rX" in primitive && "rY" in primitive) {
|
|
12353
|
+
w = primitive.rX * 2;
|
|
12354
|
+
h = primitive.rY * 2;
|
|
12333
12355
|
} else {
|
|
12334
12356
|
continue;
|
|
12335
12357
|
}
|
|
@@ -12375,8 +12397,8 @@ var MouseElementTracker = ({
|
|
|
12375
12397
|
h = boundingBox.height;
|
|
12376
12398
|
} else if ("x" in primitive && "y" in primitive) {
|
|
12377
12399
|
basePoint = { x: primitive.x, y: primitive.y };
|
|
12378
|
-
w = "w" in primitive ? primitive.w : "r" in primitive ? primitive.r * 2 : 0;
|
|
12379
|
-
h = "h" in primitive ? primitive.h : "r" in primitive ? primitive.r * 2 : 0;
|
|
12400
|
+
w = "w" in primitive ? primitive.w : "r" in primitive ? primitive.r * 2 : "rX" in primitive && "rY" in primitive ? primitive.rX * 2 : 0;
|
|
12401
|
+
h = "h" in primitive ? primitive.h : "r" in primitive ? primitive.r * 2 : "rX" in primitive && "rY" in primitive ? primitive.rY * 2 : 0;
|
|
12380
12402
|
}
|
|
12381
12403
|
if (!basePoint) continue;
|
|
12382
12404
|
const screenPos = applyToPoint12(transform, basePoint);
|
|
@@ -12825,7 +12847,7 @@ import { css as css3 } from "@emotion/css";
|
|
|
12825
12847
|
// package.json
|
|
12826
12848
|
var package_default = {
|
|
12827
12849
|
name: "@tscircuit/pcb-viewer",
|
|
12828
|
-
version: "1.11.
|
|
12850
|
+
version: "1.11.264",
|
|
12829
12851
|
main: "dist/index.js",
|
|
12830
12852
|
type: "module",
|
|
12831
12853
|
repository: "tscircuit/pcb-viewer",
|