@tscircuit/core 0.0.1031 → 0.0.1032
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.d.ts +1 -0
- package/dist/index.js +25 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -65593,6 +65593,7 @@ declare class PcbNoteDimension extends PrimitiveComponent<typeof pcbNoteDimensio
|
|
|
65593
65593
|
};
|
|
65594
65594
|
private _resolvePoint;
|
|
65595
65595
|
doInitialPcbPrimitiveRender(): void;
|
|
65596
|
+
doInitialPcbLayout(): void;
|
|
65596
65597
|
getPcbSize(): {
|
|
65597
65598
|
width: number;
|
|
65598
65599
|
height: number;
|
package/dist/index.js
CHANGED
|
@@ -12531,7 +12531,7 @@ import { identity as identity4 } from "transformation-matrix";
|
|
|
12531
12531
|
var package_default = {
|
|
12532
12532
|
name: "@tscircuit/core",
|
|
12533
12533
|
type: "module",
|
|
12534
|
-
version: "0.0.
|
|
12534
|
+
version: "0.0.1031",
|
|
12535
12535
|
types: "dist/index.d.ts",
|
|
12536
12536
|
main: "dist/index.js",
|
|
12537
12537
|
module: "dist/index.js",
|
|
@@ -20049,6 +20049,17 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
|
20049
20049
|
this.renderError(`PcbNoteDimension could not find selector "${input}"`);
|
|
20050
20050
|
return applyToPoint16(transform, { x: 0, y: 0 });
|
|
20051
20051
|
}
|
|
20052
|
+
const targetPcbComponentId = target.pcb_component_id;
|
|
20053
|
+
const root = this.root;
|
|
20054
|
+
if (targetPcbComponentId && root) {
|
|
20055
|
+
const pcbComponent = root.db.pcb_component.get(targetPcbComponentId);
|
|
20056
|
+
if (pcbComponent?.center) {
|
|
20057
|
+
return {
|
|
20058
|
+
x: pcbComponent.center.x,
|
|
20059
|
+
y: pcbComponent.center.y
|
|
20060
|
+
};
|
|
20061
|
+
}
|
|
20062
|
+
}
|
|
20052
20063
|
return target._getGlobalPcbPositionBeforeLayout();
|
|
20053
20064
|
}
|
|
20054
20065
|
const numericX = typeof input.x === "string" ? parseFloat(input.x) : input.x;
|
|
@@ -20080,6 +20091,19 @@ var PcbNoteDimension = class extends PrimitiveComponent2 {
|
|
|
20080
20091
|
});
|
|
20081
20092
|
this.pcb_note_dimension_id = pcb_note_dimension.pcb_note_dimension_id;
|
|
20082
20093
|
}
|
|
20094
|
+
doInitialPcbLayout() {
|
|
20095
|
+
const root = this.root;
|
|
20096
|
+
if (!root || root.pcbDisabled) return;
|
|
20097
|
+
if (!this.pcb_note_dimension_id) return;
|
|
20098
|
+
const { db } = root;
|
|
20099
|
+
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
20100
|
+
const from = this._resolvePoint(this._parsedProps.from, transform);
|
|
20101
|
+
const to = this._resolvePoint(this._parsedProps.to, transform);
|
|
20102
|
+
db.pcb_note_dimension.update(this.pcb_note_dimension_id, {
|
|
20103
|
+
from,
|
|
20104
|
+
to
|
|
20105
|
+
});
|
|
20106
|
+
}
|
|
20083
20107
|
getPcbSize() {
|
|
20084
20108
|
const transform = this._computePcbGlobalTransformBeforeLayout();
|
|
20085
20109
|
const from = this._resolvePoint(this._parsedProps.from, transform);
|