fix sprites for pixel ratios that are not 1 and 2
- OpenGL ES 2 doesn't allow NPOT textures with wrap-around - The Sprite object reported the map's pixelRatio, even though it loaded @2x assets - Copying icons from the sprite into the atlas now uses bilinear scaling to scale up to the actual size
This commit is contained in:
@@ -374,7 +374,7 @@ std::string Map::getStyleJSON() const {
|
||||
util::ptr<Sprite> Map::getSprite() {
|
||||
const float pixelRatio = state.getPixelRatio();
|
||||
const std::string &sprite_url = style->getSpriteURL();
|
||||
if (!sprite || sprite->pixelRatio != pixelRatio) {
|
||||
if (!sprite || !sprite->hasPixelRatio(pixelRatio)) {
|
||||
sprite = Sprite::Create(sprite_url, pixelRatio, *env);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user