@tscircuit/core 0.0.1807 → 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.
- package/dist/index.js +17 -10
- package/package.json +1 -1
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.
|
|
41983
|
+
version: "0.0.1807",
|
|
41984
41984
|
types: "dist/index.d.ts",
|
|
41985
41985
|
main: "dist/index.js",
|
|
41986
41986
|
module: "dist/index.js",
|
|
@@ -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
|
-
|
|
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
|
|
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 (!
|
|
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;
|