summaryrefslogtreecommitdiff
path: root/src/map/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/map.cpp')
-rw-r--r--src/map/map.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/map/map.cpp b/src/map/map.cpp
index 703cdf1400..50c172caaa 100644
--- a/src/map/map.cpp
+++ b/src/map/map.cpp
@@ -24,7 +24,6 @@ Map::Map(View& view)
transform(),
style(std::make_shared<Style>()),
glyphAtlas(std::make_shared<GlyphAtlas>(1024, 1024)),
- glyphStore(std::make_shared<GlyphStore>()),
spriteAtlas(std::make_shared<SpriteAtlas>(512, 512)),
texturepool(std::make_shared<Texturepool>()),
painter(*this),
@@ -439,6 +438,16 @@ void Map::prepare() {
spriteAtlas->resize(state.getPixelRatio());
}
+ // Create a new glyph store object in case the glyph URL changed.
+ // TODO: Move this to a less frequently called place; we only need to do this when the
+ // stylesheet changes.
+ if (glyphStore && glyphStore->glyphURL != style->glyph_url) {
+ glyphStore.reset();
+ }
+ if (!glyphStore && style->glyph_url.size()) {
+ glyphStore = std::make_shared<GlyphStore>(style->glyph_url);
+ }
+
if (pixelRatioChanged || dimensionsChanged) {
painter.clearFramebuffers();
}