summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2014-09-04 18:12:40 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2014-09-04 18:12:40 -0700
commit7b9ad022a904110eb15260b2cbf56e6f6b8a03cf (patch)
tree6715b0dc08fa8f4b0a4aad3c705a6c6b6cc11d45 /src
parentf2391e25ea8162562a6b355a9df8473193be88c3 (diff)
downloadqtlocation-mapboxgl-7b9ad022a904110eb15260b2cbf56e6f6b8a03cf.tar.gz
Implement text-rotation-alignment
Diffstat (limited to 'src')
-rw-r--r--src/renderer/painter_symbol.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/renderer/painter_symbol.cpp b/src/renderer/painter_symbol.cpp
index 4748a75b05..7ab8edfb40 100644
--- a/src/renderer/painter_symbol.cpp
+++ b/src/renderer/painter_symbol.cpp
@@ -24,6 +24,16 @@ void Painter::renderSymbol(SymbolBucket &bucket, std::shared_ptr<StyleLayer> lay
mat4 exMatrix;
matrix::copy(exMatrix, projMatrix);
+
+ const float angleOffset =
+ bucket.properties.text.rotation_alignment == RotationAlignmentType::Map
+ ? map.getState().getAngle()
+ : 0;
+
+ if (angleOffset) {
+ matrix::rotate_z(exMatrix, exMatrix, angleOffset);
+ }
+
if (bucket.properties.placement == PlacementType::Line) {
matrix::rotate_z(exMatrix, exMatrix, map.getState().getAngle());
}