@tscircuit/core 0.0.82 → 0.0.83
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 +14 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -582,6 +582,19 @@ var Footprint = class extends PrimitiveComponent {
|
|
|
582
582
|
(child) => child.componentName === "Constraint"
|
|
583
583
|
);
|
|
584
584
|
if (constraints.length === 0) return;
|
|
585
|
+
const { isFlipped } = this._getPcbPrimitiveFlippedHelpers();
|
|
586
|
+
const maybeFlipLeftRight = (props) => {
|
|
587
|
+
if (isFlipped) {
|
|
588
|
+
if ("left" in props && "right" in props) {
|
|
589
|
+
return {
|
|
590
|
+
...props,
|
|
591
|
+
left: props.right,
|
|
592
|
+
right: props.left
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
return props;
|
|
597
|
+
};
|
|
585
598
|
const involvedComponents = constraints.flatMap(
|
|
586
599
|
(constraint) => constraint._getAllReferencedComponents().componentsWithSelectors
|
|
587
600
|
).map(({ component, selector, componentSelector, edge }) => ({
|
|
@@ -617,7 +630,7 @@ var Footprint = class extends PrimitiveComponent {
|
|
|
617
630
|
for (const constraint of constraints) {
|
|
618
631
|
const props = constraint._parsedProps;
|
|
619
632
|
if ("xDist" in props) {
|
|
620
|
-
const { xDist, left, right, edgeToEdge, centerToCenter } = props;
|
|
633
|
+
const { xDist, left, right, edgeToEdge, centerToCenter } = maybeFlipLeftRight(props);
|
|
621
634
|
const leftVar = getKVar(`${left}_x`);
|
|
622
635
|
const rightVar = getKVar(`${right}_x`);
|
|
623
636
|
const leftBounds = getComponentDetails(left)?.bounds;
|