mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-03 04:38:33 +00:00
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.
This commit is contained in:
@@ -118,8 +118,8 @@ export function toOverlayRect(
|
||||
});
|
||||
|
||||
return {
|
||||
left: iframeRect.left - overlayRect.left + (elementRect.left - rootRect.left) * rootScaleX,
|
||||
top: iframeRect.top - overlayRect.top + (elementRect.top - rootRect.top) * rootScaleY,
|
||||
left: iframeRect.left - overlayRect.left + elementRect.left * rootScaleX,
|
||||
top: iframeRect.top - overlayRect.top + elementRect.top * rootScaleY,
|
||||
width: elementRect.width * rootScaleX,
|
||||
height: elementRect.height * rootScaleY,
|
||||
editScaleX: editScale.scaleX,
|
||||
|
||||
Reference in New Issue
Block a user