Repository navigation
fix(visual-track): stop offsetting fitted media by the Clip border twice - #424
Open
rudycelekli wants to merge 1 commit into
Open
rudycelekli wants to merge 1 commit into
rudycelekli wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
A Visual Clip with a
border-widthdraws its pictureborderpx to the right of and below the place Spatial resolved for it. It then crops the picture's right and bottomborderpx:visualContentFramealready insets the fit frame by the border (and padding), so the sample mapping is in picture coordinates inside the border.lowerVisualClipElementsmade that mapping local by subtracting the frame's border-box origin. The layers are absolutely positioned children of the:frameelement, which carries the CSSborder, and CSS positions such children from the parent's padding edge. The border was therefore added a second time, and the frame'soverflow: hiddencut off the overflow. DepthStack Cards are lowered through the same function.The sample layers' local origin is now the frame's padding edge (
frame + border). This applies to the mapping translation, the samplingtransform-originand the blurclip-pathpolygon. The frame element's ownclip-path(pathData) still resolves against the border box and is unchanged. Clips without a border lower exactly as before.The existing frame-treatment test (2px border) encoded the shift. Its expected values change from
matrix(…,62,12)/200px 150pxtomatrix(…,60,10)/198px 148px; the old values fail with the change. With the change, the Chrome render above places the picture at 120,120.Checks run:
node --import tsx --test packages/visual-track/test/*.test.ts packages/depth-stack/test/*.test.ts(33 passed)node --import tsx --test packages/html-program/test/*.test.ts packages/film/test/*.test.ts packages/composition/test/*.test.ts(50 passed)