calculate-packing 0.0.75 → 0.0.76
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 +9 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -102,14 +102,15 @@ var getComponentBounds = (component, minGap = 0) => {
|
|
|
102
102
|
};
|
|
103
103
|
const angleRad = component.ccwRotationOffset * Math.PI / 180;
|
|
104
104
|
for (const pad of component.pads) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
105
|
+
const rotatedOffset = rotatePoint(pad.offset, angleRad);
|
|
106
|
+
const cx = component.center.x + rotatedOffset.x;
|
|
107
|
+
const cy = component.center.y + rotatedOffset.y;
|
|
108
|
+
const hw = pad.size.x / 2;
|
|
109
|
+
const hh = pad.size.y / 2;
|
|
110
|
+
bounds.minX = Math.min(bounds.minX, cx - hw);
|
|
111
|
+
bounds.maxX = Math.max(bounds.maxX, cx + hw);
|
|
112
|
+
bounds.minY = Math.min(bounds.minY, cy - hh);
|
|
113
|
+
bounds.maxY = Math.max(bounds.maxY, cy + hh);
|
|
113
114
|
}
|
|
114
115
|
if (component.courtyard) {
|
|
115
116
|
expandRotatedRectIntoBounds({
|
package/package.json
CHANGED