diff options
Diffstat (limited to 'src/mbgl/text/quads.cpp')
-rw-r--r-- | src/mbgl/text/quads.cpp | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/mbgl/text/quads.cpp b/src/mbgl/text/quads.cpp index ce320791c3..eadfe5c1fd 100644 --- a/src/mbgl/text/quads.cpp +++ b/src/mbgl/text/quads.cpp @@ -57,7 +57,7 @@ SymbolQuads getIconQuads(Anchor& anchor, const PositionedIcon& shapedIcon, } SymbolQuads quads; - quads.emplace_back(tl, tr, bl, br, image.pos, 0, anchor.point, globalMinScale, std::numeric_limits<float>::infinity()); + quads.emplace_back(tl, tr, bl, br, image.pos, 0, 0, anchor.point, globalMinScale, std::numeric_limits<float>::infinity()); return quads; } @@ -102,8 +102,6 @@ void getSegmentGlyphs(std::back_insert_iterator<GlyphInstances> glyphs, Anchor & float angle = std::atan2(end.y - newAnchorPoint.y, end.x - newAnchorPoint.x); if (!forward) angle += M_PI; - if (upsideDown) - angle += M_PI; glyphs = GlyphInstance{ /* anchor */ newAnchorPoint, @@ -188,12 +186,11 @@ SymbolQuads getGlyphQuads(Anchor& anchor, const Shaping& shapedText, Point<float> tr = otr; Point<float> bl = obl; Point<float> br = obr; - const float angle = instance.angle + textRotate; - if (angle) { + if (textRotate) { // Compute the transformation matrix. - float angle_sin = std::sin(angle); - float angle_cos = std::cos(angle); + float angle_sin = std::sin(textRotate); + float angle_cos = std::cos(textRotate); std::array<float, 4> matrix = {{angle_cos, -angle_sin, angle_sin, angle_cos}}; tl = util::matrixMultiply(matrix, tl); @@ -205,8 +202,9 @@ SymbolQuads getGlyphQuads(Anchor& anchor, const Shaping& shapedText, // Prevent label from extending past the end of the line const float glyphMinScale = std::max(instance.minScale, anchor.scale); - const float glyphAngle = std::fmod((anchor.angle + textRotate + instance.offset + 2 * M_PI), (2 * M_PI)); - quads.emplace_back(tl, tr, bl, br, rect, glyphAngle, instance.anchorPoint, glyphMinScale, instance.maxScale); + const float anchorAngle = std::fmod((anchor.angle + textRotate + instance.offset + 2 * M_PI), (2 * M_PI)); + const float glyphAngle = std::fmod((instance.angle + textRotate + instance.offset + 2 * M_PI), (2 * M_PI)); + quads.emplace_back(tl, tr, bl, br, rect, anchorAngle, glyphAngle, instance.anchorPoint, glyphMinScale, instance.maxScale); } |