fix(studio): sync child overlays during parent element drag#1277
Closed
miguel-heygen wants to merge 1 commit into
Closed
fix(studio): sync child overlays during parent element drag#1277miguel-heygen wants to merge 1 commit into
miguel-heygen wants to merge 1 commit into
Conversation
When dragging a parent element's overlay, the RAF loop was fully paused to prevent flickering on the dragged element. This caused child element overlays to freeze in place since they rely on the RAF loop to measure their positions from the iframe DOM. Split the pause into two modes: rafPausedRef (full pause, used for group drags where all overlay items are manually managed) and rafSelectionOnlyPausedRef (skips only the selected element's rect update while letting hover and group rects continue measuring). Single-element drag/resize/rotate now uses the selection-only pause, so children, hover targets, and other overlays follow the parent's movement in real time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What changed
Split the RAF pause into two modes:
rafPausedRef) — used for group drags where all overlay items are already manually managed by the gesture handlerrafSelectionOnlyPausedRef) — skips only the dragged element's rect update while letting hover rects, group rects, and other element overlays continue measuring from the iframe DOMSingle-element drag, resize, and rotate gestures now use the selection-only pause. The dragged element's overlay is still manually positioned by the gesture handler (no flickering), but the RAF loop keeps running for everything else — so children, hover targets, and other visible overlays track their real positions in real time.
Test plan
#shelfcontaining child divs)