diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2015-04-09 12:05:16 -0700 |
---|---|---|
committer | Ansis Brammanis <brammanis@gmail.com> | 2015-04-09 12:05:16 -0700 |
commit | 9b0376e58ee9c7b3a94b816158b41eb8dcaf2090 (patch) | |
tree | e657c46a45f70752418ce1442d52f114b7761e55 | |
parent | 0b779eaa8b96a65d5b97df7ad468e0380f50703f (diff) | |
download | qtlocation-mapboxgl-9b0376e58ee9c7b3a94b816158b41eb8dcaf2090.tar.gz |
fix angle of icons along lines
fixes https://github.com/mapbox/mapbox-gl-native/issues/1242
-rw-r--r-- | src/mbgl/text/placement.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp index 6a142cdf65..8a221e16f7 100644 --- a/src/mbgl/text/placement.cpp +++ b/src/mbgl/text/placement.cpp @@ -146,8 +146,8 @@ Placement Placement::getIcon(Anchor &anchor, const Rect<uint16_t> &image, float float angle = layout.icon.rotate * M_PI / 180.0f; if (anchor.segment >= 0 && layout.icon.rotation_alignment != RotationAlignmentType::Viewport) { - const Coordinate &next = line[anchor.segment]; - angle += -std::atan2(next.x - anchor.x, next.y - anchor.y) + M_PI / 2; + const Coordinate &prev = line[anchor.segment]; + angle += std::atan2(anchor.y - prev.y, anchor.x - prev.x); } if (angle) { |