make icons work again
This commit is contained in:
@@ -128,9 +128,7 @@ Rect<SpriteAtlas::dimension> SpriteAtlas::allocateImage(size_t width, size_t hei
|
||||
Rect<SpriteAtlas::dimension> SpriteAtlas::getIcon(const int size, const std::string &name) {
|
||||
std::lock_guard<std::mutex> lock(mtx);
|
||||
|
||||
const std::string id = name + "-" + std::to_string(size);
|
||||
|
||||
auto rect_it = images.find(id);
|
||||
auto rect_it = images.find(name);
|
||||
if (rect_it != images.end()) {
|
||||
return rect_it->second;
|
||||
}
|
||||
@@ -143,7 +141,7 @@ Rect<SpriteAtlas::dimension> SpriteAtlas::getIcon(const int size, const std::str
|
||||
return rect;
|
||||
}
|
||||
|
||||
images.emplace(id, rect);
|
||||
images.emplace(name, rect);
|
||||
|
||||
allocate();
|
||||
|
||||
@@ -158,7 +156,7 @@ Rect<SpriteAtlas::dimension> SpriteAtlas::getIcon(const int size, const std::str
|
||||
1.0f / size / pixelRatio
|
||||
);
|
||||
|
||||
uninitialized.emplace(id);
|
||||
uninitialized.emplace(name);
|
||||
|
||||
dirty = true;
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ void Painter::renderIcon(IconBucket& bucket, std::shared_ptr<StyleLayer> layer_d
|
||||
useProgram(iconShader->program);
|
||||
iconShader->setMatrix(matrix);
|
||||
// TODO: update
|
||||
// iconShader->setColor(color);
|
||||
iconShader->setColor({{ 1, 1, 1, 1 }});
|
||||
iconShader->setImage(0);
|
||||
iconShader->setRatio(map.getState().getPixelRatio());
|
||||
iconShader->setDimension({{
|
||||
|
||||
Reference in New Issue
Block a user