[docs] Add guide for transformations example#4289
Open
m-bert wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new documentation guide explaining how to implement a “photo viewer” interaction (pan + pinch + rotation simultaneously) using matrix composition, and updates the transformations examples to use 3×3 affine matrices instead of 4×4 matrices.
Changes:
- Added a new “Transforming a view” guide with conceptual explanation and a full example.
- Updated both example-app transformations screens to use 3×3 matrix helpers (
identity3/multiply3/translate3/scale3/rotate3) and adjusted translation indices accordingly. - Aligned transformed-coordinate conversion to the new 3×3 matrix layout (2×2 linear part extracted from
[0,1,3,4]).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/docs-gesture-handler/docs/guides/transformations.mdx | New guide documenting multi-gesture transforms via affine matrices, including a full example snippet. |
| apps/common-app/src/new_api/complicated/transformations/index.tsx | Migrates the new API transformations example from 4×4 to 3×3 matrix math and updates transform extraction. |
| apps/common-app/src/legacy/v2_api/transformations/index.tsx | Migrates the legacy/v2 API transformations example from 4×4 to 3×3 matrix math and updates transform extraction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+113
to
+115
| const det = a * d - b * c; | ||
|
|
||
| return [d / det, -b / det, -c / det, a / det]; |
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.
Description
Originally we thought about adding
useTransformGesturehook. However, we decided to drop the idea and describe important caveats in docs guide.I've also updated transformations examples to use 3x3 matrices instead of 4x4.
Test plan