circuit-to-svg 0.0.103 → 0.0.105
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 +16 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -911,6 +911,8 @@ function convertCircuitJsonToPcbSvg(soup, options) {
|
|
|
911
911
|
updateBounds({ x: item.x, y: item.y }, 0, 0);
|
|
912
912
|
} else if ("route" in item) {
|
|
913
913
|
updateTraceBounds(item.route);
|
|
914
|
+
} else if (item.type === "pcb_silkscreen_text" || item.type === "pcb_silkscreen_rect" || item.type === "pcb_silkscreen_circle" || item.type === "pcb_silkscreen_line") {
|
|
915
|
+
updateSilkscreenBounds(item);
|
|
914
916
|
}
|
|
915
917
|
}
|
|
916
918
|
const padding = 1;
|
|
@@ -1030,6 +1032,20 @@ function convertCircuitJsonToPcbSvg(soup, options) {
|
|
|
1030
1032
|
maxY = Math.max(maxY, point.y);
|
|
1031
1033
|
}
|
|
1032
1034
|
}
|
|
1035
|
+
function updateSilkscreenBounds(item) {
|
|
1036
|
+
if (item.type === "pcb_silkscreen_text") {
|
|
1037
|
+
updateBounds(item.anchor_position, 0, 0);
|
|
1038
|
+
} else if (item.type === "pcb_silkscreen_path") {
|
|
1039
|
+
updateTraceBounds(item.route);
|
|
1040
|
+
} else if (item.type === "pcb_silkscreen_rect") {
|
|
1041
|
+
updateBounds(item.center, item.width, item.height);
|
|
1042
|
+
} else if (item.type === "pcb_silkscreen_circle") {
|
|
1043
|
+
updateBounds(item.center, item.radius * 2, item.radius * 2);
|
|
1044
|
+
} else if (item.type === "pcb_silkscreen_line") {
|
|
1045
|
+
updateBounds({ x: item.x1, y: item.y1 }, 0, 0);
|
|
1046
|
+
updateBounds({ x: item.x2, y: item.y2 }, 0, 0);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1033
1049
|
}
|
|
1034
1050
|
function createSvgObjects(elm, transform, soup, shouldDrawErrors) {
|
|
1035
1051
|
switch (elm.type) {
|