circuit-to-svg 0.0.127 → 0.0.129
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 +15 -15
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1612,11 +1612,11 @@ import { applyToPoint as applyToPoint20 } from "transformation-matrix";
|
|
|
1612
1612
|
|
|
1613
1613
|
// lib/utils/get-sch-font-size.ts
|
|
1614
1614
|
import "transformation-matrix";
|
|
1615
|
-
var getSchMmFontSize = (textType) => {
|
|
1616
|
-
return textType === "error" ? 0.05 : textType === "pin_number" ? 0.15 : 0.18;
|
|
1615
|
+
var getSchMmFontSize = (textType, fontSize) => {
|
|
1616
|
+
return textType === "error" ? 0.05 : textType === "pin_number" ? 0.15 : fontSize ? fontSize : 0.18;
|
|
1617
1617
|
};
|
|
1618
|
-
var getSchScreenFontSize = (transform, textType) => {
|
|
1619
|
-
return Math.abs(transform.a) * getSchMmFontSize(textType);
|
|
1618
|
+
var getSchScreenFontSize = (transform, textType, fontSize) => {
|
|
1619
|
+
return Math.abs(transform.a) * getSchMmFontSize(textType, fontSize);
|
|
1620
1620
|
};
|
|
1621
1621
|
|
|
1622
1622
|
// lib/assembly/svg-object-fns/create-svg-objects-from-assembly-component.ts
|
|
@@ -2939,6 +2939,10 @@ var createSvgSchText = ({
|
|
|
2939
2939
|
const center = applyToPoint30(transform, elm.position);
|
|
2940
2940
|
const textAnchorMap = {
|
|
2941
2941
|
center: "middle",
|
|
2942
|
+
center_right: "end",
|
|
2943
|
+
bottom_left: "start",
|
|
2944
|
+
bottom_center: "middle",
|
|
2945
|
+
bottom_right: "end",
|
|
2942
2946
|
left: "start",
|
|
2943
2947
|
right: "end",
|
|
2944
2948
|
top: "middle",
|
|
@@ -2946,14 +2950,14 @@ var createSvgSchText = ({
|
|
|
2946
2950
|
top_left: "start",
|
|
2947
2951
|
top_center: "middle",
|
|
2948
2952
|
top_right: "end",
|
|
2949
|
-
center_left: "start"
|
|
2950
|
-
center_right: "end",
|
|
2951
|
-
bottom_left: "start",
|
|
2952
|
-
bottom_center: "middle",
|
|
2953
|
-
bottom_right: "end"
|
|
2953
|
+
center_left: "start"
|
|
2954
2954
|
};
|
|
2955
2955
|
const dominantBaselineMap = {
|
|
2956
2956
|
center: "middle",
|
|
2957
|
+
center_right: "middle",
|
|
2958
|
+
bottom_left: "ideographic",
|
|
2959
|
+
bottom_center: "ideographic",
|
|
2960
|
+
bottom_right: "ideographic",
|
|
2957
2961
|
left: "middle",
|
|
2958
2962
|
right: "middle",
|
|
2959
2963
|
top: "hanging",
|
|
@@ -2961,11 +2965,7 @@ var createSvgSchText = ({
|
|
|
2961
2965
|
top_left: "hanging",
|
|
2962
2966
|
top_center: "hanging",
|
|
2963
2967
|
top_right: "hanging",
|
|
2964
|
-
center_left: "middle"
|
|
2965
|
-
center_right: "middle",
|
|
2966
|
-
bottom_left: "ideographic",
|
|
2967
|
-
bottom_center: "ideographic",
|
|
2968
|
-
bottom_right: "ideographic"
|
|
2968
|
+
center_left: "middle"
|
|
2969
2969
|
};
|
|
2970
2970
|
return {
|
|
2971
2971
|
type: "element",
|
|
@@ -2978,7 +2978,7 @@ var createSvgSchText = ({
|
|
|
2978
2978
|
"text-anchor": textAnchorMap[elm.anchor],
|
|
2979
2979
|
"dominant-baseline": dominantBaselineMap[elm.anchor],
|
|
2980
2980
|
"font-family": "sans-serif",
|
|
2981
|
-
"font-size": `${getSchScreenFontSize(transform, "reference_designator")}px`,
|
|
2981
|
+
"font-size": `${getSchScreenFontSize(transform, "reference_designator", elm.font_size)}px`,
|
|
2982
2982
|
transform: `rotate(${elm.rotation}, ${center.x}, ${center.y})`
|
|
2983
2983
|
},
|
|
2984
2984
|
children: [
|