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

Move towards the reverse direction after drag a long distance #8996

Open
ReevesSher opened this issue Nov 20, 2019 · 1 comment
Open

Move towards the reverse direction after drag a long distance #8996

ReevesSher opened this issue Nov 20, 2019 · 1 comment
Labels

Comments

@ReevesSher
Copy link

mapbox-gl-js version: 1.4.1 (I guess almost every version has this issue)

browser: Chrome 78
platform: Windows 10

Steps to Trigger Behavior

  1. Drag fast from bottom to top at some angle (It won`t happen when you just drag a short distance or at no angle)

Link to Demonstration

bug

Expected Behavior

move towards the right direction

Actual Behavior

move towards the right direction at the first moment
and then move towards reverse direction till stop moving

@mpulkki-mapbox
Copy link
Contributor

I've noticed the same bug while working on the LOD support #8975. I don't have a production ready fix for this but the cause is well known.

We're applying inertia to the mouse cursor and with fast enough mouse movement this can fling the cursor way above the screen. When this behavior is combined with bigger pitch angles the flinged position might end up being above the horizon (ie. ray cast towards this point will never hit the ground when travelling forward). This will result in intersections being reported somewhere "behind" they ray (t < 0) causing the inverse movement direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants