easyeda 0.0.346 → 0.0.348
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/browser/index.js +9 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/main.cjs +10 -2
- package/dist/main.cjs.map +1 -1
- package/package.json +1 -1
package/dist/main.cjs
CHANGED
|
@@ -1026,7 +1026,7 @@ var import_promises = __toESM(require("fs/promises"), 1);
|
|
|
1026
1026
|
var package_default = {
|
|
1027
1027
|
name: "easyeda",
|
|
1028
1028
|
type: "module",
|
|
1029
|
-
version: "0.0.
|
|
1029
|
+
version: "0.0.347",
|
|
1030
1030
|
files: [
|
|
1031
1031
|
"dist"
|
|
1032
1032
|
],
|
|
@@ -8472,8 +8472,16 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
8472
8472
|
const t = DEFAULT_PCB_THICKNESS_MM / 2;
|
|
8473
8473
|
const attrs = svgNode?.svgData?.attrs ?? {};
|
|
8474
8474
|
const modelHeight = readModelHeightMm(attrs.c_height);
|
|
8475
|
+
const cadModelSize = resolvedCadModelBounds ? {
|
|
8476
|
+
x: resolvedCadModelBounds.max.x - resolvedCadModelBounds.min.x,
|
|
8477
|
+
y: resolvedCadModelBounds.max.y - resolvedCadModelBounds.min.y,
|
|
8478
|
+
z: resolvedCadModelBounds.max.z - resolvedCadModelBounds.min.z
|
|
8479
|
+
} : void 0;
|
|
8480
|
+
const hasValidCadModelSize = cadModelSize !== void 0 && Object.values(cadModelSize).every(
|
|
8481
|
+
(dimension) => Number.isFinite(dimension) && dimension > 0
|
|
8482
|
+
);
|
|
8475
8483
|
if (!cad.size) {
|
|
8476
|
-
cad.size = {
|
|
8484
|
+
cad.size = hasValidCadModelSize ? cadModelSize : {
|
|
8477
8485
|
x: pcb_component2.width,
|
|
8478
8486
|
y: pcb_component2.height,
|
|
8479
8487
|
z: modelHeight
|