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

Fix incorrect textPixelRatio argument #6135

Merged
merged 2 commits into from
Feb 13, 2018
Merged

Fix incorrect textPixelRatio argument #6135

merged 2 commits into from
Feb 13, 2018

Commits on Feb 12, 2018

  1. Add failing test for issue #6075

    Anand Thakker committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    a0926cb View commit details
    Browse the repository at this point in the history
  2. Fix incorrect textPixelRatio argument

    Closes #6075
    
    `textPixelRatio` is used to scale tile coordinates to viewport
    coordinates; the value that was being passed here, EXTENT / tileSize,
    was the reciprocal of the ratio needed -- we were passing 16 instead of
    0.0625.
    
    As a result, the corners of the viewport-projected collision box that we
    reconstructed here,
    https://github.com/mapbox/mapbox-gl-js/blob/f13c86ea356c384fdab31855b9152f5bf5ef97b8/src/symbol/collision_index.js#L322-L325,
    were 16^2 times farther from the anchor than they should have been. With
    `icon-offset: [0, 0]`, this didn't matter, because the incorrectly large
    box would contain the (much smaller) correct box.  But when there's an
    offset, it too gets scaled too much, and so we run out of luck.
    Anand Thakker committed Feb 12, 2018
    Configuration menu
    Copy the full SHA
    455c005 View commit details
    Browse the repository at this point in the history