New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camera tests #3720
Closed
Closed
Camera tests #3720
Conversation
This file contains 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
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Taha-Hassan-Git
temporarily deployed
to
deploy-staging
May 8, 2024 11:07
— with
GitHub Actions
Inactive
Taha-Hassan-Git
temporarily deployed
to
deploy-staging
May 8, 2024 11:12
— with
GitHub Actions
Inactive
Taha-Hassan-Git
temporarily deployed
to
deploy-staging
May 8, 2024 11:15
— with
GitHub Actions
Inactive
Taha-Hassan-Git
temporarily deployed
to
deploy-staging
May 8, 2024 11:44
— with
GitHub Actions
Inactive
Taha-Hassan-Git
temporarily deployed
to
deploy-staging
May 8, 2024 11:48
— with
GitHub Actions
Inactive
Taha-Hassan-Git
commented
May 8, 2024
await mouse.wheel(0, 15) // 0.9 | ||
await mouse.wheel(0, 15) // 0.81 | ||
await mouse.wheel(0, 15) // 0.72 | ||
await keyboard.up('Control') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is odd, if I await a single mouse.wheel event, even if I set the delta y to 1000000, it only zooms to 0.9. It maxes out at 15 pixels, any more and there is no further change.
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.
This PR adds tests for camera panning and pinching.
It simulates touch events necessary for panning and zooming by dispatching events to the browser. I could encapsulate this logic into a fixture or functions to use in other tests if it felt useful. Something like gesture.pinch({start: {}, end: {}, steps: number}), gesture.pan({start: {}, end: {}, steps: number}).
It simulates trackpad pinching by dispatching a scroll wheel event, though I haven't been able to work out the relationship between pixels scrolled and zoom speed. It also seems important to await each scroll event in steps for some reason.
Change Type
sdk
— Changes the tldraw SDKdotcom
— Changes the tldraw.com web appdocs
— Changes to the documentation, examples, or templates.vs code
— Changes to the vscode plugininternal
— Does not affect user-facing stuffbugfix
— Bug fixfeature
— New featureimprovement
— Improving existing featureschore
— Updating dependencies, other boring stuffgalaxy brain
— Architectural changestests
— Changes to any test codetools
— Changes to infrastructure, CI, internal scripts, debugging tools, etc.dunno
— I don't knowTest Plan
Release Notes