circuit-to-svg 0.0.201 → 0.0.202
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 +21 -19
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1783,7 +1783,7 @@ function getSoftwareUsedString(circuitJson) {
|
|
|
1783
1783
|
var package_default = {
|
|
1784
1784
|
name: "circuit-to-svg",
|
|
1785
1785
|
type: "module",
|
|
1786
|
-
version: "0.0.
|
|
1786
|
+
version: "0.0.201",
|
|
1787
1787
|
description: "Convert Circuit JSON to SVG",
|
|
1788
1788
|
main: "dist/index.js",
|
|
1789
1789
|
files: [
|
|
@@ -6013,20 +6013,23 @@ var createSvgObjectsForSchPortBoxLine = ({
|
|
|
6013
6013
|
}
|
|
6014
6014
|
const screenSchPortPos = applyToPoint40(transform, schPort.center);
|
|
6015
6015
|
const screenRealEdgePos = applyToPoint40(transform, realEdgePos);
|
|
6016
|
+
const isConnected = isSourcePortConnected(circuitJson, schPort.source_port_id);
|
|
6016
6017
|
const realLineEnd = { ...schPort.center };
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6018
|
+
if (!isConnected) {
|
|
6019
|
+
switch (schPort.side_of_component) {
|
|
6020
|
+
case "left":
|
|
6021
|
+
realLineEnd.x += PIN_CIRCLE_RADIUS_MM;
|
|
6022
|
+
break;
|
|
6023
|
+
case "right":
|
|
6024
|
+
realLineEnd.x -= PIN_CIRCLE_RADIUS_MM;
|
|
6025
|
+
break;
|
|
6026
|
+
case "top":
|
|
6027
|
+
realLineEnd.y -= PIN_CIRCLE_RADIUS_MM;
|
|
6028
|
+
break;
|
|
6029
|
+
case "bottom":
|
|
6030
|
+
realLineEnd.y += PIN_CIRCLE_RADIUS_MM;
|
|
6031
|
+
break;
|
|
6032
|
+
}
|
|
6030
6033
|
}
|
|
6031
6034
|
const screenLineEnd = applyToPoint40(transform, realLineEnd);
|
|
6032
6035
|
svgObjects.push({
|
|
@@ -6034,16 +6037,15 @@ var createSvgObjectsForSchPortBoxLine = ({
|
|
|
6034
6037
|
type: "element",
|
|
6035
6038
|
attributes: {
|
|
6036
6039
|
class: "component-pin",
|
|
6037
|
-
x1:
|
|
6038
|
-
y1:
|
|
6039
|
-
x2:
|
|
6040
|
-
y2:
|
|
6040
|
+
x1: screenRealEdgePos.x.toString(),
|
|
6041
|
+
y1: screenRealEdgePos.y.toString(),
|
|
6042
|
+
x2: screenLineEnd.x.toString(),
|
|
6043
|
+
y2: screenLineEnd.y.toString(),
|
|
6041
6044
|
"stroke-width": `${getSchStrokeSize(transform)}px`
|
|
6042
6045
|
},
|
|
6043
6046
|
value: "",
|
|
6044
6047
|
children: []
|
|
6045
6048
|
});
|
|
6046
|
-
const isConnected = isSourcePortConnected(circuitJson, schPort.source_port_id);
|
|
6047
6049
|
const pinRadiusPx = Math.abs(transform.a) * PIN_CIRCLE_RADIUS_MM;
|
|
6048
6050
|
const pinChildren = [];
|
|
6049
6051
|
if (!isConnected) {
|