Skip to content

Commit c6c301f

Browse files
authored
Use local bounds helper for group bounding boxes (#497)
1 parent 2f0a6bf commit c6c301f

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/components/GroupAnchorOffsetOverlay/calculateGroupBoundingBox.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
import { getBoundsFromPoints } from "@tscircuit/math-utils"
21
import type { PcbComponent } from "circuit-json"
3-
import type { BoundingBox } from "../../lib/util/get-primitive-bounding-box"
4-
2+
import {
3+
type BoundingBox,
4+
getBoundsFromPoints,
5+
} from "../../lib/util/get-primitive-bounding-box"
56
export const calculateGroupBoundingBox = (
67
groupComponents: PcbComponent[],
78
): BoundingBox | null => {

src/components/ToolbarOverlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ export const ToolbarOverlay = ({ children, elements }: Props) => {
706706
)
707707
}}
708708
/>
709-
<CheckboxMenuItem
709+
<CheckboxMenuItem
710710
label="Show Group Anchor Offsets"
711711
checked={viewSettings.is_showing_group_anchor_offsets}
712712
onClick={() => {

src/lib/util/get-primitive-bounding-box.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ const createBoxFromPoints = (
5454

5555
return { minX, maxX, minY, maxY }
5656
}
57+
export const getBoundsFromPoints = createBoxFromPoints
5758

5859
const mergeBoundingBoxesInternal = (
5960
a: BoundingBox,

0 commit comments

Comments
 (0)