circuit-json-to-kicad 0.0.12 → 0.0.14

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -665,12 +665,14 @@ var AddSchematicSymbolsStage = class extends ConverterStage {
665
665
  }
666
666
  }
667
667
  const symbolCenter = symbol.center || { x: 0, y: 0 };
668
+ const isVertical = symbolName.includes("_down") || symbolName.includes("_up");
669
+ const horizontalTextOffset = isVertical ? 0.15 : 0;
668
670
  const refTextPos = refTextPrimitive && this.ctx.c2kMatSch ? applyToPoint2(this.ctx.c2kMatSch, {
669
- x: schematicComponent.center.x + (refTextPrimitive.x - symbolCenter.x),
671
+ x: schematicComponent.center.x + (refTextPrimitive.x - symbolCenter.x) + horizontalTextOffset,
670
672
  y: schematicComponent.center.y + (refTextPrimitive.y - symbolCenter.y)
671
673
  }) : { x: symbolKicadPos.x, y: symbolKicadPos.y - 6 };
672
674
  const valTextPos = valTextPrimitive && this.ctx.c2kMatSch ? applyToPoint2(this.ctx.c2kMatSch, {
673
- x: schematicComponent.center.x + (valTextPrimitive.x - symbolCenter.x),
675
+ x: schematicComponent.center.x + (valTextPrimitive.x - symbolCenter.x) + horizontalTextOffset,
674
676
  y: schematicComponent.center.y + (valTextPrimitive.y - symbolCenter.y)
675
677
  }) : { x: symbolKicadPos.x, y: symbolKicadPos.y + 6 };
676
678
  return { refTextPos, valTextPos };
@@ -915,8 +917,8 @@ var CircuitJsonToKicadSchConverter = class {
915
917
  }
916
918
  constructor(circuitJson) {
917
919
  const CIRCUIT_JSON_SCALE_FACTOR = 15;
918
- const KICAD_CENTER_X = 95.25;
919
- const KICAD_CENTER_Y = 73.66;
920
+ const KICAD_CENTER_Y = 105;
921
+ const KICAD_CENTER_X = 148.5;
920
922
  const db = cju(circuitJson);
921
923
  const { center } = getSchematicBoundsAndCenter(db);
922
924
  this.ctx = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "circuit-json-to-kicad",
3
3
  "main": "dist/index.js",
4
- "version": "0.0.12",
4
+ "version": "0.0.14",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"