Skip to content

Commit

Permalink
fix: BoundingBox from
Browse files Browse the repository at this point in the history
  • Loading branch information
qq15725 committed Oct 25, 2024
1 parent d81adb7 commit 81f14e6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/math/BoundingBox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export class BoundingBox {
}

static from(...boxes: BoundingBox[]): BoundingBox {
if (boxes.length === 0) {
return new BoundingBox()
}
else if (boxes.length === 1) {
return boxes[0].clone()
}
const firstBox = boxes[0]
const merged = boxes.slice(1).reduce(
(merged, box) => {
Expand Down

0 comments on commit 81f14e6

Please sign in to comment.