Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

don't scale when adding to sprite atlas #3530

Merged
merged 2 commits into from
Jan 13, 2016
Merged

Conversation

ansis
Copy link
Contributor

@ansis ansis commented Jan 13, 2016

Don't scale images when adding them to the sprite atlas and make the sprite atlas match -js.

fix #3164 and port https://github.com/mapbox/mapbox-gl-js/pull/1919/files

can you review @jfirebaugh?

@jfirebaugh
Copy link
Contributor

Also fixes #3513?

@mb12
Copy link

mb12 commented Jan 13, 2016

@ansis Can SpriteAtlas::bind be unconditionally called with linear=true?

@jfirebaugh
Copy link
Contributor

What about this scaling code?

@ansis
Copy link
Contributor Author

ansis commented Jan 13, 2016

Also fixes #3513?

Yes, except for #3528

@ansis Can SpriteAtlas::bind be unconditionally called with linear=true?

Using nearest neighbour filtering is clearer when icons copied at their original size. This small bit of extra clarity matters since icons are already pretty small.

What about this scaling code?

yeah, that needs to be removed.

@ansis ansis force-pushed the sprite-atlas-no-scaling branch 2 times, most recently from bd112e4 to fc20199 Compare January 13, 2016 03:34
@ansis
Copy link
Contributor Author

ansis commented Jan 13, 2016

The nearest neighbour scaling code is removed in fc20199

@ansis
Copy link
Contributor Author

ansis commented Jan 13, 2016

@jfirebaugh I think this should be good now. Want to take another look?

int dstI = dstY * dstStride + dstX;
int x, y;

if (wrap && false) {
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh, good catch. I'll remove and add a render test to catch this kind of bug: mapbox/mapbox-gl-test-suite#72

@ansis
Copy link
Contributor Author

ansis commented Jan 13, 2016

scaling.hpp is removed in 0930972

the wrapping bug is fixed in e16a487 and covered with a new render test: mapbox/mapbox-gl-test-suite@a7e5668

do you see anything else or can this be squashed and merged (once tests ci passes)?

@jfirebaugh
Copy link
Contributor

LGTM

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

Successfully merging this pull request may close these issues.

never scale images when copying them into the SpriteAtlas
3 participants