Skip to content
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

Work around pan deceleration on pitched maps #773

Merged
merged 3 commits into from
Oct 20, 2021

Conversation

macdrevx
Copy link
Contributor

@macdrevx macdrevx commented Oct 19, 2021

Pull request checklist:

  • Briefly describe the changes in this PR.
  • Write tests for all new functionality. If tests were not written, please explain why.
  • Apply changelog label ('breaking change', 'bug 🪲', 'build', 'docs', 'feature 🍏', 'performance ⚡', 'testing 💯') or use the label 'skip changelog'
  • Update the changelog

Summary of changes

When the map is pitched, pan gestures may cause unexpectedly large changes during deceleration. This is a bug in the underlying drag API, but until that is fixed, we're introducing a workaround that causes the deceleration to happen more quickly or be skipped altogether on pitched maps. This implementation is an adaptation of the ideas in mapbox/mapbox-maps-android#754 although that approach does not apply exactly since pan deceleration is implemented differently on iOS.

Before:

Before.mp4

After:

After.mp4

@macdrevx macdrevx added the skip changelog Add this label if this item does not need to be included in the changelog label Oct 19, 2021
@macdrevx macdrevx requested a review from tobrun October 19, 2021 20:36
@endanke
Copy link
Contributor

endanke commented Oct 20, 2021

This is a bug in the underlying drag API

@macdrevx Is there a ticket for this bug? If not yet I can open one and will check it later in gl-native.

@macdrevx macdrevx force-pushed the ah/pan-deceleration-workaround branch from b572f66 to 07d5dd1 Compare October 20, 2021 17:43
Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@jmkiley jmkiley self-requested a review October 20, 2021 19:08
@macdrevx macdrevx merged commit 31acae8 into main Oct 20, 2021
@macdrevx macdrevx deleted the ah/pan-deceleration-workaround branch October 20, 2021 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip changelog Add this label if this item does not need to be included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants