diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-01-13 12:02:04 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-01-17 19:23:20 +0100 |
commit | b6c11191723d6eb884de5ee17d658298f5dd4127 (patch) | |
tree | 2de2bcc074b47563a8dcbe2039e3384faf32ddf9 /src/mbgl/text/glyph_atlas.cpp | |
parent | 4439aecbcc21aae8b71c9b9a0bd65d9d128d6c83 (diff) | |
download | qtlocation-mapboxgl-b6c11191723d6eb884de5ee17d658298f5dd4127.tar.gz |
[core] harden Glyph PBF parsing
Diffstat (limited to 'src/mbgl/text/glyph_atlas.cpp')
-rw-r--r-- | src/mbgl/text/glyph_atlas.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mbgl/text/glyph_atlas.cpp b/src/mbgl/text/glyph_atlas.cpp index 5d30dacdce..17b3e7e482 100644 --- a/src/mbgl/text/glyph_atlas.cpp +++ b/src/mbgl/text/glyph_atlas.cpp @@ -107,9 +107,6 @@ Rect<uint16_t> GlyphAtlas::addGlyph(uintptr_t tileUID, const FontStack& fontStack, const SDFGlyph& glyph) { - // Use constant value for now. - const uint8_t buffer = 3; - std::map<uint32_t, GlyphValue>& face = index[fontStack]; auto it = face.find(glyph.id); @@ -125,8 +122,8 @@ Rect<uint16_t> GlyphAtlas::addGlyph(uintptr_t tileUID, return Rect<uint16_t>{ 0, 0, 0, 0 }; } - uint16_t buffered_width = glyph.metrics.width + buffer * 2; - uint16_t buffered_height = glyph.metrics.height + buffer * 2; + uint16_t buffered_width = glyph.metrics.width + SDFGlyph::borderSize * 2; + uint16_t buffered_height = glyph.metrics.height + SDFGlyph::borderSize * 2; // Add a 1px border around every image. const uint16_t padding = 1; |