Skip to content

Commit 6bc5175

Browse files
mattgperrymergatron[bot]
authored andcommitted
Adding break
1 parent 54b956b commit 6bc5175

File tree

1 file changed

+3
-4
lines changed
  • packages/framer-motion/src/render/dom/scroll/offsets

1 file changed

+3
-4
lines changed

packages/framer-motion/src/render/dom/scroll/offsets/inset.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ export function calcInset(element: Element, container: HTMLElement) {
2020
const parentBoundingBox = current.getBoundingClientRect()
2121
inset.x += svgBoundingBox.left - parentBoundingBox.left
2222
inset.y += svgBoundingBox.top - parentBoundingBox.top
23-
} else if (
24-
current instanceof SVGGraphicsElement &&
25-
"getBBox" in current
26-
) {
23+
} else if (current instanceof SVGGraphicsElement) {
2724
const { x, y } = current.getBBox()
2825
inset.x += x
2926
inset.y += y
@@ -37,6 +34,8 @@ export function calcInset(element: Element, container: HTMLElement) {
3734
parent = current.parentNode as SVGElement
3835
}
3936
current = svg
37+
} else {
38+
break
4039
}
4140
}
4241

0 commit comments

Comments
 (0)