Repository navigation
fix(core): a sealed scale resize shows its new scale once saved, not the old one - #8554
Merged
Merged
Conversation
Contributor
Edit accuracy: accurate 271 (base branch 271), smooth 56 of thoseThe gate passes. Quarantined, measured but not gated (0) Unstable (1)
|
vanceingalls
approved these changes
Nov 23, 2026
vanceingalls
left a comment
Collaborator
There was a problem hiding this comment.
Approved at 6d569af, CI green. The first windows-latest: engine-cli-3 lane was cancelled at its 35-minute limit mid package-tests, so the aggregate failed. This PR touches only core's editingDraft runtime, main's Windows runs were green, and the rerun passed.
- Fix:
restorenow skipstransformunless the draft itself drew one. Only the rotation'stransformroute setsdrewTransform, and clearing a rotation restores its transform before resetting the flag, so #8469's rotations keep their put-back. A scale resize's cancel (sizeSavedAsScale) no longer overwrites the scale and x/y GSAP just wrote into the same inlinetransform. - Evidence: the "fails without the fix" unit test shows exactly that overwrite on main (
translate(10px, 0px)over GSAP'stranslate(30px, 0px) scale(1.5, 1.5)). The bench takes the sealed scale case from about 60 px to 0.06–0.24 px with all 124 rotate cases clean, and the merge bisect pins the start at #8469. The unsealed path is untouched.
Non-blocking: as the body says, resize-scale-px-r0-root-z100-on still flashes to its start for one frame after release (teleport 60.14) before landing. That's worth its own follow-up row.
Merged
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.
What
In a sealed preview, a scale resize now shows its new scale and position as soon as it is saved. Since #8469 the preview put the layer back where it was before the drag, about 60 px from where it was dropped, until the page was reloaded. The saved file and an export were already right, and an unsealed preview was never affected.
Why
A sealed resize draws its size in the frame as a draft. When the size is saved as a GSAP scale, Studio cancels that draft (
manualOffsetDraftEnd.ts,sizeSavedAsScale), and the frame puts back the inline styles the draft changed. #8469 addedtransformto that list, so a rotation drawn as atransformcan be cancelled. But GSAP writes its scale and x/y into the same inlinetransform. So the cancel put back the transform from the start of the drag, over the scale and position GSAP had just drawn for the save.Related work
Fixes the regression from #8469 for scale resizes; #8469's rotations behave as before.
How
packages/core/src/runtime/editingDraft.ts: a draft putstransformback only when it drew one itself, which only the rotation'stransformroute does. Once that rotation stops drawing and its transform is put back, a later cancel leavestransformalone, so it can't overwrite what GSAP draws after.Test plan
fails without the fix:
packages/core/src/runtime/editingDraft.test.ts, "leaves a transform it never drew to GSAP when it puts the rest back". On main the cancel puts backtranslate(10px, 0px)over GSAP'stranslate(30px, 0px) scale(1.5, 1.5).With the fix, on a Linux machine:
editingDraft.test.ts,editingAgent.test.ts(including #8469's rotation rows) andeditingGestureStart.test.tspass three runs in a row (199 tests). The push gate's named and covering files, coretsc, Fallow and pre-push are clean.Bench
Edit-accuracy bench on a Linux machine, main at 35a0d81 with and without this change, the same bench for both: the 3 sealed scale resize cases and all 124 rotate cases (#8469's own), one run per mode. A case is off when any of tracking, teleport, drop or reload is over 1 px.
resize-scale-px-r0-root-z100after / mid / on, droprotate-tween-xpercent-r0-root-z50)A merge bisect of main into the scale fix's head, with this bench at every step, puts the start at #8469: the merge at the commit before it drops at 0.06 px, the merge at #8469 at 60.15 px.
Still off sealed with this change:
resize-scale-px-r0-root-z100-onflashes back to its start position for one frame after release (teleport 60.14), then lands on the drop point. Before this change it stayed there.No visible change
Sealed previews are off by default, so nothing changes for anyone yet. With them on, a scale-resized layer stays where it was dropped after the save.