From 2ae2cade4a8a0ed8b77616c73281896feaa39204 Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Fri, 29 May 2015 13:33:30 -0400 Subject: [PATCH] fix assertion. only include glyphs with metrics fixes bug caught by this assertion: https://github.com/mapbox/mapbox-gl-native/blob/de3fd89b2cb259c965629aa9aea17729511229f7/src/mbgl/text/font_stack.cpp#L124 --- src/mbgl/text/font_stack.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mbgl/text/font_stack.cpp b/src/mbgl/text/font_stack.cpp index adabe2eb6..fc1be0fb7 100644 --- a/src/mbgl/text/font_stack.cpp +++ b/src/mbgl/text/font_stack.cpp @@ -32,9 +32,9 @@ const Shaping FontStack::getShaping(const std::u32string &string, const float ma // Loop through all characters of this label and shape. for (uint32_t chr : string) { - shaping.positionedGlyphs.emplace_back(chr, x, y); auto metric = metrics.find(chr); if (metric != metrics.end()) { + shaping.positionedGlyphs.emplace_back(chr, x, y); x += metric->second.advance + spacing; } }