circuit-to-svg 0.0.201 → 0.0.203

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 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.200",
1786
+ version: "0.0.202",
1787
1787
  description: "Convert Circuit JSON to SVG",
1788
1788
  main: "dist/index.js",
1789
1789
  files: [
@@ -1812,7 +1812,7 @@ var package_default = {
1812
1812
  "react-cosmos": "7.0.0",
1813
1813
  "react-cosmos-plugin-vite": "7.0.0",
1814
1814
  "react-dom": "19.1.0",
1815
- tscircuit: "^0.0.654",
1815
+ tscircuit: "^0.0.671",
1816
1816
  tsup: "^8.0.2",
1817
1817
  typescript: "^5.4.5",
1818
1818
  "vite-tsconfig-paths": "^5.0.1"
@@ -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
- switch (schPort.side_of_component) {
6018
- case "left":
6019
- realLineEnd.x += PIN_CIRCLE_RADIUS_MM;
6020
- break;
6021
- case "right":
6022
- realLineEnd.x -= PIN_CIRCLE_RADIUS_MM;
6023
- break;
6024
- case "top":
6025
- realLineEnd.y -= PIN_CIRCLE_RADIUS_MM;
6026
- break;
6027
- case "bottom":
6028
- realLineEnd.y += PIN_CIRCLE_RADIUS_MM;
6029
- break;
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: screenLineEnd.x.toString(),
6038
- y1: screenLineEnd.y.toString(),
6039
- x2: screenRealEdgePos.x.toString(),
6040
- y2: screenRealEdgePos.y.toString(),
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) {