Repository navigation
Fix pinch zoom drifting away from the fingers on touch screens - #7
Merged
Merged
Conversation
Two things made the zoom point drift away from the fingers on touch screens: - A one-finger pan (Konva stage drag, on the Pan tool) could still be running when a second finger landed. The drag and the pinch then both moved the stage. The stage drag now stops when a pinch starts and is restored after. - The pinch anchor added the finger movement a second time, and the fallback path mixed layer and map coordinates for rotated maps. The step is now a single pure function (pinchViewport) that keeps the stage point under the previous centre under the new centre, starting from what is on screen. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Fix pinch zoom drifting away from the fingers on touch screens
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully 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.
Summary
Brings the pinch-zoom fix into
main. PR #4 merged intofeat/responsive-layout, but that branch never reachedmain. This PR carries only the pinch commit, so it can merge cleanly.See #4 for the cause and fix: the stage drag is stopped during a pinch, and the anchor maths is a single tested function (
pinchViewport).Testing
bun run test(28 pass, including the 4 new pinch tests),bun run lintandbun run buildpass on this branch.🤖 Generated with Claude Code