summaryrefslogtreecommitdiff
path: root/src/mbgl/text/placement.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/text/placement.cpp')
-rw-r--r--src/mbgl/text/placement.cpp4
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) {