fix: pan the globe from the center when the grab is off the sphere - #8174
Open
mondsichtung wants to merge 1 commit into
Open
fix: pan the globe from the center when the grab is off the sphere#8174mondsichtung wants to merge 1 commit into
mondsichtung wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8174 +/- ##
==========================================
- Coverage 93.92% 93.91% -0.01%
==========================================
Files 290 290
Lines 24916 24917 +1
Branches 6575 6576 +1
==========================================
- Hits 23402 23401 -1
- Misses 1514 1516 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Collaborator
|
Can you share a before and after video maybe? Or an interactive site that has the old and new behavior side by side? |
Contributor
Author
|
Attached both a GIF as well as a JSBin URL. |
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.
Dragging the globe from the empty space around it barely moves the map and often in the wrong direction; releasing then flings it fast the way the cursor actually moved, because the inertia only looks at the pixel offset.
JSBin
This regressed in #8154: panning makes the grabbed surface point follow the cursor. To reproduce on its demo, https://jcolot.github.io/maplibre-gl-js/, grab the empty space top right of the globe with the mouse and drag left. Off the sphere there is no such point, so a falloff substitutes one near the globe's edge, and dragging mostly swings that point around the center, a motion panning with a fixed bearing discards; only the small part of the drag aimed at or away from the globe still pans.
Grabs that miss the sphere now pan from the screen center, the same fallback the gesture's zoom already uses in
HandlerManager._applyChanges. Off the globe the map now moves a pixel per pixel in the drag direction, matching the inertia; grabs on the globe are unchanged (#5296).Launch Checklist
*.bench.ts), post before/after results ofnpm run bench(the compare workflow is intest/bench/README.md).CHANGELOG.mdunder the## mainsection.Assisted-By: Claude Code (Opus 5, xhigh)