diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2014-11-04 10:53:35 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2014-11-04 12:26:27 -0800 |
commit | 051e1c32ae4f553085adfc7b66e005ef70f62349 (patch) | |
tree | ca934665c051c4616a796528adb4f4cc4e288d9f /src | |
parent | 0790b574b43322a0ea85e6ec6488b16dc74e11ce (diff) | |
download | qtlocation-mapboxgl-051e1c32ae4f553085adfc7b66e005ef70f62349.tar.gz |
Support compound text-anchor values
Diffstat (limited to 'src')
-rw-r--r-- | src/renderer/symbol_bucket.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/renderer/symbol_bucket.cpp b/src/renderer/symbol_bucket.cpp index e80f1505bf..a005449628 100644 --- a/src/renderer/symbol_bucket.cpp +++ b/src/renderer/symbol_bucket.cpp @@ -106,18 +106,35 @@ void SymbolBucket::addFeatures(const VectorTileLayer &layer, const FilterExpress float verticalAlign = 0.5; switch (properties.text.anchor) { + case TextAnchorType::Top: + case TextAnchorType::Bottom: case TextAnchorType::Center: break; case TextAnchorType::Right: + case TextAnchorType::TopRight: + case TextAnchorType::BottomRight: horizontalAlign = 1; break; case TextAnchorType::Left: + case TextAnchorType::TopLeft: + case TextAnchorType::BottomLeft: horizontalAlign = 0; break; + } + + switch (properties.text.anchor) { + case TextAnchorType::Left: + case TextAnchorType::Right: + case TextAnchorType::Center: + break; case TextAnchorType::Bottom: + case TextAnchorType::BottomLeft: + case TextAnchorType::BottomRight: verticalAlign = 1; break; case TextAnchorType::Top: + case TextAnchorType::TopLeft: + case TextAnchorType::TopRight: verticalAlign = 0; break; } |