circuit-to-svg 0.0.149 → 0.0.151

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
@@ -4453,31 +4453,16 @@ var ninePointAnchorToTextAnchor2 = {
4453
4453
  middle_bottom: "middle"
4454
4454
  };
4455
4455
  var ninePointAnchorToDominantBaseline = {
4456
- top_left: "auto",
4457
- top_right: "auto",
4458
- bottom_left: "hanging",
4459
- bottom_right: "hanging",
4460
- center: "auto",
4456
+ top_left: "hanging",
4457
+ top_right: "hanging",
4458
+ bottom_left: "ideographic",
4459
+ bottom_right: "ideographic",
4460
+ center: "middle",
4461
4461
  middle_left: "middle",
4462
4462
  middle_right: "middle",
4463
- middle_top: "auto",
4464
- middle_bottom: "hanging"
4463
+ middle_top: "hanging",
4464
+ middle_bottom: "ideographic"
4465
4465
  };
4466
- function getTextOffsets(pathRotation, transform) {
4467
- const scale9 = Math.abs(transform.a);
4468
- const baseOffset = scale9 * 0.1;
4469
- const rotationOffsetMap = {
4470
- "0": { x: baseOffset * 0.8, y: -baseOffset },
4471
- // Left
4472
- "-90": { x: baseOffset * -3.5, y: baseOffset * 2.8 },
4473
- // Top
4474
- "90": { x: -baseOffset * -3.55, y: -baseOffset * 4.2 },
4475
- // Bottom
4476
- "180": { x: -baseOffset * 0.85, y: -baseOffset * 0.2 }
4477
- // Right
4478
- };
4479
- return rotationOffsetMap[pathRotation.toString()] || { x: 0, y: 0 };
4480
- }
4481
4466
 
4482
4467
  // lib/sch/svg-object-fns/create-svg-objects-for-sch-net-label-with-symbol.ts
4483
4468
  var createSvgObjectsForSchNetLabelWithSymbol = ({
@@ -4518,12 +4503,7 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
4518
4503
  x: schNetLabel.center.x - realTextGrowthVec.x * fullWidthFsr * fontSizeMm / 2,
4519
4504
  y: schNetLabel.center.y - realTextGrowthVec.y * fullWidthFsr * fontSizeMm / 2
4520
4505
  };
4521
- const pathRotation = {
4522
- left: 0,
4523
- top: -90,
4524
- bottom: 90,
4525
- right: 180
4526
- }[schNetLabel.anchor_side];
4506
+ const pathRotation = 0;
4527
4507
  const rotationMatrix = rotate4(pathRotation / 180 * Math.PI);
4528
4508
  const symbolBounds = {
4529
4509
  minX: Math.min(
@@ -4547,7 +4527,7 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
4547
4527
  )
4548
4528
  )
4549
4529
  };
4550
- const symbolEndPoint = {
4530
+ const symbolEndPoint = symbol.ports?.[0] ? { x: symbol.ports[0].x, y: symbol.ports[0].y } : {
4551
4531
  x: symbolBounds.minX,
4552
4532
  y: (symbolBounds.minY + symbolBounds.maxY) / 2
4553
4533
  };
@@ -4621,10 +4601,9 @@ var createSvgObjectsForSchNetLabelWithSymbol = ({
4621
4601
  }
4622
4602
  const scale9 = Math.abs(realToScreenTransform.a);
4623
4603
  const baseOffset = scale9 * 0.1;
4624
- const rotationOffset = getTextOffsets(pathRotation, realToScreenTransform);
4625
4604
  const offsetScreenPos = {
4626
- x: screenTextPos.x + rotationOffset.x,
4627
- y: screenTextPos.y + rotationOffset.y
4605
+ x: screenTextPos.x,
4606
+ y: screenTextPos.y
4628
4607
  };
4629
4608
  svgObjects.push({
4630
4609
  name: "text",