diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2015-05-29 13:33:30 -0400 |
---|---|---|
committer | Ansis Brammanis <brammanis@gmail.com> | 2015-06-02 11:33:03 -0400 |
commit | 2ae2cade4a8a0ed8b77616c73281896feaa39204 (patch) | |
tree | c79da13fca46243013753e2017c6c2c2807b672e /src/mbgl | |
parent | 36212ea3c63f5b757997341e7c5b13bca902d2e2 (diff) | |
download | qtlocation-mapboxgl-2ae2cade4a8a0ed8b77616c73281896feaa39204.tar.gz |
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
Diffstat (limited to 'src/mbgl')
-rw-r--r-- | src/mbgl/text/font_stack.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mbgl/text/font_stack.cpp b/src/mbgl/text/font_stack.cpp index adabe2eb69..fc1be0fb72 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; } } |