Skip to content

Commit 45e03ab

Browse files
committed
fix(studio): remove rootRect subtraction from overlay position formula
elementRect.left/top from getBoundingClientRect() already reflects GSAP transforms in viewport coordinates. Subtracting rootRect.left/top cancels the transform, pinning overlays to the un-animated layout position. Use elementRect directly so overlays track elements during scroll (y: -500) and entrance (scale: 0.95) animations.
1 parent 30969c6 commit 45e03ab

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/studio/src/components/editor/domEditOverlayGeometry.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ export function toOverlayRect(
118118
});
119119

120120
return {
121-
left: iframeRect.left - overlayRect.left + (elementRect.left - rootRect.left) * rootScaleX,
122-
top: iframeRect.top - overlayRect.top + (elementRect.top - rootRect.top) * rootScaleY,
121+
left: iframeRect.left - overlayRect.left + elementRect.left * rootScaleX,
122+
top: iframeRect.top - overlayRect.top + elementRect.top * rootScaleY,
123123
width: elementRect.width * rootScaleX,
124124
height: elementRect.height * rootScaleY,
125125
editScaleX: editScale.scaleX,

0 commit comments

Comments
 (0)