-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Simplify and fix sprite atlas coordinate calculations #4737
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I don't have any feedback or questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have to use getter methods instead of properties here? Let's make sure the overhead from creating tons of new array objects doesn't add up in the frame duration benchmark.
def33fa
to
0edbd2a
Compare
I had to revert the getters for other reasons, anyway (object must be plain JSON to send to worker). Final benchmarks:
|
0edbd2a
to
3ec524e
Compare
* Always return image metrics exclusive of padding * Work with integer coordinates whenever possible * Eliminate redundant SpriteAtlasElement members * Fix asymmetric re-padding in getIconQuad when pixelRatio != 1 * Add explanatory comments
3ec524e
to
7478d79
Compare
GL JS counterpart of mapbox/mapbox-gl-native#9038.