circuit-to-svg 0.0.273 → 0.0.274
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 +26 -15
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -3490,23 +3490,34 @@ function createSvgObjectsFromPcbCutout(cutout, ctx) {
|
|
|
3490
3490
|
const scaledWidth = rectCutout.width * Math.abs(transform.a);
|
|
3491
3491
|
const scaledHeight = rectCutout.height * Math.abs(transform.d);
|
|
3492
3492
|
const svgRotation = -(rectCutout.rotation ?? 0);
|
|
3493
|
+
const { corner_radius } = rectCutout;
|
|
3494
|
+
const baseCornerRadius = typeof corner_radius === "number" && corner_radius > 0 ? corner_radius : 0;
|
|
3495
|
+
const transformedCornerRadiusX = baseCornerRadius * Math.abs(transform.a);
|
|
3496
|
+
const transformedCornerRadiusY = baseCornerRadius * Math.abs(transform.d);
|
|
3497
|
+
const attributes = {
|
|
3498
|
+
class: "pcb-cutout pcb-cutout-rect",
|
|
3499
|
+
x: (-scaledWidth / 2).toString(),
|
|
3500
|
+
y: (-scaledHeight / 2).toString(),
|
|
3501
|
+
width: scaledWidth.toString(),
|
|
3502
|
+
height: scaledHeight.toString(),
|
|
3503
|
+
fill: colorMap2.drill,
|
|
3504
|
+
transform: matrixToString6(
|
|
3505
|
+
compose3(translate3(cx, cy), rotate3(svgRotation * Math.PI / 180))
|
|
3506
|
+
),
|
|
3507
|
+
"data-type": "pcb_cutout",
|
|
3508
|
+
"data-pcb-layer": "drill"
|
|
3509
|
+
};
|
|
3510
|
+
if (transformedCornerRadiusX > 0) {
|
|
3511
|
+
attributes.rx = transformedCornerRadiusX.toString();
|
|
3512
|
+
}
|
|
3513
|
+
if (transformedCornerRadiusY > 0) {
|
|
3514
|
+
attributes.ry = transformedCornerRadiusY.toString();
|
|
3515
|
+
}
|
|
3493
3516
|
return [
|
|
3494
3517
|
{
|
|
3495
3518
|
name: "rect",
|
|
3496
3519
|
type: "element",
|
|
3497
|
-
attributes
|
|
3498
|
-
class: "pcb-cutout pcb-cutout-rect",
|
|
3499
|
-
x: (-scaledWidth / 2).toString(),
|
|
3500
|
-
y: (-scaledHeight / 2).toString(),
|
|
3501
|
-
width: scaledWidth.toString(),
|
|
3502
|
-
height: scaledHeight.toString(),
|
|
3503
|
-
fill: colorMap2.drill,
|
|
3504
|
-
transform: matrixToString6(
|
|
3505
|
-
compose3(translate3(cx, cy), rotate3(svgRotation * Math.PI / 180))
|
|
3506
|
-
),
|
|
3507
|
-
"data-type": "pcb_cutout",
|
|
3508
|
-
"data-pcb-layer": "drill"
|
|
3509
|
-
},
|
|
3520
|
+
attributes,
|
|
3510
3521
|
children: [],
|
|
3511
3522
|
value: ""
|
|
3512
3523
|
}
|
|
@@ -4279,7 +4290,7 @@ function getSoftwareUsedString(circuitJson) {
|
|
|
4279
4290
|
var package_default = {
|
|
4280
4291
|
name: "circuit-to-svg",
|
|
4281
4292
|
type: "module",
|
|
4282
|
-
version: "0.0.
|
|
4293
|
+
version: "0.0.273",
|
|
4283
4294
|
description: "Convert Circuit JSON to SVG",
|
|
4284
4295
|
main: "dist/index.js",
|
|
4285
4296
|
files: [
|
|
@@ -4303,7 +4314,7 @@ var package_default = {
|
|
|
4303
4314
|
"bun-match-svg": "^0.0.12",
|
|
4304
4315
|
esbuild: "^0.20.2",
|
|
4305
4316
|
"performance-now": "^2.1.0",
|
|
4306
|
-
"circuit-json": "^0.0.
|
|
4317
|
+
"circuit-json": "^0.0.317",
|
|
4307
4318
|
react: "19.1.0",
|
|
4308
4319
|
"react-cosmos": "7.0.0",
|
|
4309
4320
|
"react-cosmos-plugin-vite": "7.0.0",
|