Repository navigation
fix(studio): sealed group moves, resizes and rotations reach the preview as early as single moves - #8912
fix(studio): sealed group moves, resizes and rotations reach the preview as early as single moves#8912miguel-heygen wants to merge 2 commits into
Conversation
…iew as early as single moves Only a single layer's move drew its steps from the raw pointer update, and only from its second step on. A group move, a resize and a rotation still drew each step from pointermove, which runs in the task that paints the frame, and every kind's first step went out from pointermove too. Each kind's step is now computed once (gestureSteps.ts) and drawn from the raw update for any held sealed gesture, armed at press.
|
Test plan addition at ef60878: a fifth test drives a real press through |
Edit accuracy: accurate 273 (base branch 271), smooth 67 of thoseThe gate passes. Newly passing (2)
Not banked yet, reported and not gated (bank a full-grid run's baseline.json) (2)
Quarantined, measured but not gated (0) Unstable (1)
|
BeforeA sealed group drag (two layers, shift-click, drag) in Chrome with the preview sharing Studio's process, one mid-drag frame at 2x: the layers trail the pointer. AfterThe same frame on this branch: the layers are under the pointer. The green outline is drawn by Studio a frame late on both trees, a separate fix, so read the layers against the pointer, not against the outline. Group board, layer steps behind the drawn pointer (most common value per drag, 3 sealed and 3 unsealed sessions per mode, interleaved):
With this branch the sealed group sits inside the unsealed range in both modes. |


What
In a sealed preview, a group move, a resize and a rotation now reach the preview as early as a single-layer move already does, and every kind's first step does too. Before, each of those steps was drawn one display frame after the pointer.
Why
A sealed preview only draws what Studio posts to it. A single-layer move posts each step from the browser's raw pointer update, which fires before the task that paints the frame. Everything else still posted from
pointermove, which runs inside that task, so the preview drew the step a frame late:pointermove, so that step went out 3.6 to 4.6 ms after the move instead of before the paint.Related work
Follows #8899, which did this for a single-layer move.
How
gestureSteps.tscomputes each kind's step once:rotationAt,resizeSizeAt, plus the existingsnappedDragDeltaand a newgroupDragDeltalifted out of the group mover.pointermove, the release and the raw update all use them, so the two paths cannot disagree.armSealedRawSteps, called at press in bothstartGestureandstartGroupDrag, arms the raw update for any held gesture when the preview is sealed. The raw step draws only the preview's drafts; the overlay, readouts and guides stay onpointermove. A draft equal to the last one is not posted twice (drawsNothingNew, from fix(studio): a sealed drag sends each step to the preview as the pointer moves #8899), so the second draw frompointermovecosts nothing.pointerrawupdateare unchanged.Test plan
sealedRawDragStep.test.ts: a group move draws every member, a rotation draws its angle and a resize draws its size, each from the raw update; a real press throughstartGesturedraws the first step from the raw update with nopointermovebefore it. Fails without the fix: all four (3 with the kinds left onpointermove, 1 with the press-time arming removed).src/components/editor: 188 files, 2225 tests pass.