@tscircuit/core 0.0.142 → 0.0.143
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 +6 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2244,7 +2244,13 @@ var NormalComponent = class extends PrimitiveComponent {
|
|
|
2244
2244
|
const { db } = this.root;
|
|
2245
2245
|
const { _parsedProps: props } = this;
|
|
2246
2246
|
const bounds = getBoundsOfPcbComponents(this.children);
|
|
2247
|
+
if (bounds.width === 0 || bounds.height === 0) return;
|
|
2248
|
+
const center = {
|
|
2249
|
+
x: (bounds.minX + bounds.maxX) / 2,
|
|
2250
|
+
y: (bounds.minY + bounds.maxY) / 2
|
|
2251
|
+
};
|
|
2247
2252
|
db.pcb_component.update(this.pcb_component_id, {
|
|
2253
|
+
center,
|
|
2248
2254
|
width: bounds.width,
|
|
2249
2255
|
height: bounds.height
|
|
2250
2256
|
});
|