easyeda 0.0.347 → 0.0.349
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/browser/index.js
CHANGED
|
@@ -11236,8 +11236,16 @@ var convertEasyEdaJsonToCircuitJson = (easyEdaJson, {
|
|
|
11236
11236
|
const t = DEFAULT_PCB_THICKNESS_MM / 2;
|
|
11237
11237
|
const attrs = svgNode?.svgData?.attrs ?? {};
|
|
11238
11238
|
const modelHeight = readModelHeightMm(attrs.c_height);
|
|
11239
|
+
const cadModelSize = resolvedCadModelBounds ? {
|
|
11240
|
+
x: resolvedCadModelBounds.max.x - resolvedCadModelBounds.min.x,
|
|
11241
|
+
y: resolvedCadModelBounds.max.y - resolvedCadModelBounds.min.y,
|
|
11242
|
+
z: resolvedCadModelBounds.max.z - resolvedCadModelBounds.min.z
|
|
11243
|
+
} : void 0;
|
|
11244
|
+
const hasValidCadModelSize = cadModelSize !== void 0 && Object.values(cadModelSize).every(
|
|
11245
|
+
(dimension) => Number.isFinite(dimension) && dimension > 0
|
|
11246
|
+
);
|
|
11239
11247
|
if (!cad.size) {
|
|
11240
|
-
cad.size = {
|
|
11248
|
+
cad.size = hasValidCadModelSize ? cadModelSize : {
|
|
11241
11249
|
x: pcb_component2.width,
|
|
11242
11250
|
y: pcb_component2.height,
|
|
11243
11251
|
z: modelHeight
|