circuit-to-svg 0.0.116 → 0.0.117
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 +6 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1352,7 +1352,7 @@ var getSchScreenFontSize = (transform, textType) => {
|
|
|
1352
1352
|
|
|
1353
1353
|
// lib/assembly/svg-object-fns/create-svg-objects-from-assembly-component.ts
|
|
1354
1354
|
function createSvgObjectsFromAssemblyComponent(component, transform, firstPin, name) {
|
|
1355
|
-
const { center, width, height, rotation = 0 } = component;
|
|
1355
|
+
const { center, width, height, rotation = 0, layer = "top" } = component;
|
|
1356
1356
|
const [x, y] = applyToPoint19(transform, [center.x, center.y]);
|
|
1357
1357
|
const [pinX, pinY] = applyToPoint19(transform, [firstPin.x, firstPin.y]);
|
|
1358
1358
|
const scaledWidth = width * Math.abs(transform.a);
|
|
@@ -1372,13 +1372,14 @@ function createSvgObjectsFromAssemblyComponent(component, transform, firstPin, n
|
|
|
1372
1372
|
y,
|
|
1373
1373
|
pinX,
|
|
1374
1374
|
pinY,
|
|
1375
|
-
rotation
|
|
1375
|
+
rotation,
|
|
1376
|
+
layer
|
|
1376
1377
|
),
|
|
1377
1378
|
createComponentLabel(scaledWidth, scaledHeight, name ?? "", transform)
|
|
1378
1379
|
]
|
|
1379
1380
|
};
|
|
1380
1381
|
}
|
|
1381
|
-
function createComponentPath(scaledWidth, scaledHeight, centerX, centerY, pinX, pinY, rotation) {
|
|
1382
|
+
function createComponentPath(scaledWidth, scaledHeight, centerX, centerY, pinX, pinY, rotation, layer) {
|
|
1382
1383
|
const w = scaledWidth / 2;
|
|
1383
1384
|
const h = scaledHeight / 2;
|
|
1384
1385
|
const cornerSize = Math.min(w, h) * 0.3;
|
|
@@ -1393,7 +1394,8 @@ function createComponentPath(scaledWidth, scaledHeight, centerX, centerY, pinX,
|
|
|
1393
1394
|
class: "assembly-component",
|
|
1394
1395
|
d: path,
|
|
1395
1396
|
"stroke-width": strokeWidth.toFixed(2),
|
|
1396
|
-
transform: `rotate(${-rotation})
|
|
1397
|
+
transform: `rotate(${-rotation})`,
|
|
1398
|
+
"stroke-dasharray": layer === "bottom" ? "2,2" : ""
|
|
1397
1399
|
},
|
|
1398
1400
|
value: "",
|
|
1399
1401
|
children: []
|