summaryrefslogtreecommitdiff
path: root/src/mbgl/text/quads.cpp
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2015-04-02 12:39:30 -0700
committerAnsis Brammanis <brammanis@gmail.com>2015-04-02 12:39:30 -0700
commit02d2ddef5255f54fe08f6fa5d08bd19536fa817c (patch)
tree7c6592873f1025811e4dac447ad63b9e201f8291 /src/mbgl/text/quads.cpp
parent7b02800ad908347133494f9f1334d2384d5ead48 (diff)
downloadqtlocation-mapboxgl-02d2ddef5255f54fe08f6fa5d08bd19536fa817c.tar.gz
fix quad offsets by subtracting buffer
-js doesn't have this here because it subtracts the buffer earlier. https://github.com/mapbox/mapbox-gl-js/blob/617e590c833040407508606b9dbdae2abc3a305d/js/symbol/glyph_source.js#L75 We should match -js eventually.
Diffstat (limited to 'src/mbgl/text/quads.cpp')
-rw-r--r--src/mbgl/text/quads.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mbgl/text/quads.cpp b/src/mbgl/text/quads.cpp
index ca76dfe9fe..c2bb3d8229 100644
--- a/src/mbgl/text/quads.cpp
+++ b/src/mbgl/text/quads.cpp
@@ -149,8 +149,11 @@ SymbolQuads getGlyphQuads(Anchor &anchor, const Shaping &shapedText,
glyphInstances.emplace_back(GlyphInstance{anchor});
}
- const float x1 = positionedGlyph.x + glyph.metrics.left;
- const float y1 = positionedGlyph.y - glyph.metrics.top;
+ // The rects have an addditional buffer that is not included in their size;
+ const float rectBuffer = 3.0f;
+
+ const float x1 = positionedGlyph.x + glyph.metrics.left - rectBuffer;
+ const float y1 = positionedGlyph.y - glyph.metrics.top - rectBuffer;
const float x2 = x1 + rect.w;
const float y2 = y1 + rect.h;