@tscircuit/core 0.0.1806 → 0.0.1808

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 +18 -11
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -41980,7 +41980,7 @@ function Group_getRoutingPhasePlans(group) {
41980
41980
  var package_default = {
41981
41981
  name: "@tscircuit/core",
41982
41982
  type: "module",
41983
- version: "0.0.1805",
41983
+ version: "0.0.1807",
41984
41984
  types: "dist/index.d.ts",
41985
41985
  main: "dist/index.js",
41986
41986
  module: "dist/index.js",
@@ -42029,7 +42029,7 @@ var package_default = {
42029
42029
  "@tscircuit/jlcpcb-manufacturing-specs": "git+https://github.com/tscircuit/jlcpcb-manufacturing-specs#e08af159db01a37db007e33f0a7268d0e4a279a5",
42030
42030
  "@tscircuit/krt-wasm": "^0.1.1",
42031
42031
  "@tscircuit/log-soup": "^1.0.2",
42032
- "@tscircuit/matchpack": "^0.0.84",
42032
+ "@tscircuit/matchpack": "^0.0.88",
42033
42033
  "@tscircuit/math-utils": "^0.0.36",
42034
42034
  "@tscircuit/miniflex": "^0.0.4",
42035
42035
  "@tscircuit/ngspice-spice-engine": "^0.0.20",
@@ -54170,11 +54170,12 @@ var SchematicSymbol = class extends PrimitiveComponent2 {
54170
54170
  };
54171
54171
 
54172
54172
  // lib/components/primitive-components/SchematicSection.ts
54173
+ import { doBoundsOverlap as doBoundsOverlap3 } from "@tscircuit/math-utils";
54174
+ import { schematicSectionProps } from "@tscircuit/props";
54173
54175
  import {
54174
54176
  calculateCellBoundaries,
54175
54177
  computeBoundsFromCellContents
54176
54178
  } from "calculate-cell-boundaries";
54177
- import { schematicSectionProps } from "@tscircuit/props";
54178
54179
  var SchematicSection = class _SchematicSection extends PrimitiveComponent2 {
54179
54180
  isSchematicPrimitive = true;
54180
54181
  get config() {
@@ -54288,16 +54289,22 @@ var SchematicSection = class _SchematicSection extends PrimitiveComponent2 {
54288
54289
  const vDividers = dividers.filter(
54289
54290
  (l) => Math.abs(l.start.x - l.end.x) < TOL4
54290
54291
  );
54291
- for (const {
54292
- displayName,
54293
- sectionTitleFontSize,
54294
- rawBounds
54295
- } of allSectionsWithBounds) {
54292
+ for (const sectionWithBounds of allSectionsWithBounds) {
54293
+ const { displayName, sectionTitleFontSize, rawBounds, cell } = sectionWithBounds;
54296
54294
  if (!displayName) continue;
54295
+ const overlapsAnotherSection = allSectionsWithBounds.some(
54296
+ (section) => section !== sectionWithBounds && doBoundsOverlap3(section.rawBounds, rawBounds)
54297
+ );
54297
54298
  const dividersAbove = hDividers.map((l) => l.start.y).filter((y) => y > rawBounds.maxY);
54298
54299
  const topBoundary = dividersAbove.length > 0 ? Math.min(...dividersAbove) : outer.maxY;
54299
54300
  const dividersToLeft = vDividers.map((l) => l.start.x).filter((x) => x < rawBounds.minX);
54300
- const leftBoundary = dividersToLeft.length > 0 ? Math.max(...dividersToLeft) : outer.minX;
54301
+ let leftBoundary = outer.minX;
54302
+ if (overlapsAnotherSection) {
54303
+ leftBoundary = cell.minX;
54304
+ }
54305
+ if (dividersToLeft.length > 0) {
54306
+ leftBoundary = Math.max(...dividersToLeft);
54307
+ }
54301
54308
  db.schematic_text.insert({
54302
54309
  anchor: "top_left",
54303
54310
  text: displayName,
@@ -55073,7 +55080,7 @@ var AnalogSweepParameter = class extends PrimitiveComponent2 {
55073
55080
  import { voltageProbeProps } from "@tscircuit/props";
55074
55081
 
55075
55082
  // lib/utils/schematic/selectBestLabelAlignment.ts
55076
- import { doBoundsOverlap as doBoundsOverlap3 } from "@tscircuit/math-utils";
55083
+ import { doBoundsOverlap as doBoundsOverlap4 } from "@tscircuit/math-utils";
55077
55084
  function getLabelBounds(probePosition, labelText, alignment, labelOffset = 0.3) {
55078
55085
  const charWidth = 0.1;
55079
55086
  const labelWidth = Math.max(labelText.length * charWidth, 0.3);
@@ -55144,7 +55151,7 @@ function getElementBounds(elm) {
55144
55151
  return null;
55145
55152
  }
55146
55153
  function getOverlapArea(a, b) {
55147
- if (!doBoundsOverlap3(a, b)) return 0;
55154
+ if (!doBoundsOverlap4(a, b)) return 0;
55148
55155
  const overlapWidth = Math.min(a.maxX, b.maxX) - Math.max(a.minX, b.minX);
55149
55156
  const overlapHeight = Math.min(a.maxY, b.maxY) - Math.max(a.minY, b.minY);
55150
55157
  return overlapWidth * overlapHeight;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.1806",
4
+ "version": "0.0.1808",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -50,7 +50,7 @@
50
50
  "@tscircuit/jlcpcb-manufacturing-specs": "git+https://github.com/tscircuit/jlcpcb-manufacturing-specs#e08af159db01a37db007e33f0a7268d0e4a279a5",
51
51
  "@tscircuit/krt-wasm": "^0.1.1",
52
52
  "@tscircuit/log-soup": "^1.0.2",
53
- "@tscircuit/matchpack": "^0.0.84",
53
+ "@tscircuit/matchpack": "^0.0.88",
54
54
  "@tscircuit/math-utils": "^0.0.36",
55
55
  "@tscircuit/miniflex": "^0.0.4",
56
56
  "@tscircuit/ngspice-spice-engine": "^0.0.20",