circuit-to-svg 0.0.147 → 0.0.149
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 +18 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -882,7 +882,7 @@ function createSvgObjectsFromPcbTrace(trace, ctx) {
|
|
|
882
882
|
const layer = "layer" in start ? start.layer : "layer" in end ? end.layer : null;
|
|
883
883
|
if (!layer) continue;
|
|
884
884
|
if (layerFilter && layer !== layerFilter) continue;
|
|
885
|
-
const layerColor = layerNameToColor(layer, colorMap2);
|
|
885
|
+
const layerColor = colorMap2.soldermask[layer] ?? layerNameToColor(layer, colorMap2);
|
|
886
886
|
const traceWidth = "width" in start ? start.width : "width" in end ? end.width : null;
|
|
887
887
|
const svgObject = {
|
|
888
888
|
name: "path",
|
|
@@ -980,6 +980,23 @@ function createSvgObjectsFromSmtPad(pad, ctx) {
|
|
|
980
980
|
}
|
|
981
981
|
];
|
|
982
982
|
}
|
|
983
|
+
if (pad.shape === "circle") {
|
|
984
|
+
const radius = pad.radius * Math.abs(transform.a);
|
|
985
|
+
const [x, y] = applyToPoint11(transform, [pad.x, pad.y]);
|
|
986
|
+
return [
|
|
987
|
+
{
|
|
988
|
+
name: "circle",
|
|
989
|
+
type: "element",
|
|
990
|
+
attributes: {
|
|
991
|
+
class: "pcb-pad",
|
|
992
|
+
fill: layerNameToColor(pad.layer, colorMap2),
|
|
993
|
+
cx: x.toString(),
|
|
994
|
+
cy: y.toString(),
|
|
995
|
+
r: radius.toString()
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
];
|
|
999
|
+
}
|
|
983
1000
|
if (pad.shape === "polygon") {
|
|
984
1001
|
const points = (pad.points ?? []).map(
|
|
985
1002
|
(point) => applyToPoint11(transform, [point.x, point.y])
|