refactor(studio): place the selection chrome from rect variables on one wrapper - #4810
Closed
miguel-heygen wants to merge 3 commits into
Closed
miguel-heygen wants to merge 3 commits into
miguel-heygen wants to merge 3 commits into
Conversation
Edit accuracy: 434 passing here, 434 on the base branchThe gate passes. |
Collaborator
Author
|
Closing on measurement. On the edit-accuracy bench (same machine, same Chrome, both arms):
|
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
The selection chrome now takes its position from four CSS variables on one wrapper. The resize dots, the rotate handle, the rotation plane's transform-origin and the crop frame are each placed with
calc()over--hf-chrome-left/top/width/height, and React writes those four variables fromoverlayRectat render. Every on-screen position is the same as before.This is the first half of taking the chrome's React work off pointermove. Today every move or resize pointermove sets the overlay rect state, and about ten chrome components re-render on every step. The follow-up change in the gesture handler will write these four variables on the wrapper per pointermove, so the whole chrome follows with one style write and the rect state is set once on release. On its own this PR changes no per-frame cost, and the selection box itself keeps its numeric position until the gesture-side change, because the gesture handler still writes
box.styledirectly.The variable names have one owner,
domEditChromeRect.ts.Test
DomEditSelectionChrome.test.tsx, "moves every handle with the rect while their own styles stay the same":left/topstyles are identical between the two renders, so only the wrapper changes;calc()against the wrapper's variables and checks it lands where the numeric formula used to put it (dots, rotate handle, crop frame).On main's source it fails: the handle styles differ between the rects.