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

Use correct pixel ratio when creating image buffer from map.addImage() #4645

Merged
merged 3 commits into from
Apr 27, 2017

Conversation

asheemmamoowala
Copy link
Contributor

@asheemmamoowala asheemmamoowala commented Apr 26, 2017

This closes #4637

In addition to our code not computing the pixelRatio of the passed in image for display correctly, I found that the Sprite Atlas class was not setting its internal pixelRatio to match the device pixel ratio during construction. This should fix both issues.

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
    - [ ] document any changes to public APIs
    - [ ] post benchmark scores
  • manually test the debug page

@mourner
Copy link
Member

mourner commented Apr 26, 2017

Just wondering, do we have a way to emulate retina on the render tests to catch issues like this?

@kkaefer
Copy link
Member

kkaefer commented Apr 26, 2017

Just wondering, do we have a way to emulate retina on the render tests to catch issues like this?

Yeah, you can specify "pixelRatio": 2 in the metadata section of the render test. There are already a few existing tests for retina. It'd be cool to have a test for this, and check GL native for the same bug.

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

Successfully merging this pull request may close these issues.

On retina screens, images added with addImage are half-size
4 participants