summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/symbol_layer_impl.cpp
diff options
context:
space:
mode:
authorYoung Hahn <young@mapbox.com>2016-06-10 23:05:15 -0400
committerGitHub <noreply@github.com>2016-06-10 23:05:15 -0400
commitecd4aa14397ed081a521d8412557724e52f277f3 (patch)
treea04bca00190eba8f3f3947689ab6b7ff537e8946 /src/mbgl/style/layers/symbol_layer_impl.cpp
parenta8df0feb5414af2c16bfdae27431d779e4545dbe (diff)
downloadqtlocation-mapboxgl-ecd4aa14397ed081a521d8412557724e52f277f3.tar.gz
text-pitch-alignment (#5288)
* First pass at port of https://github.com/mapbox/mapbox-gl-js/pull/2668 * RotationAlignmentType => AlignmentType * Handle undefined default value for text-pitch-alignment and implement inheritance for this value from text-rotation-alignment * Update dependencies * Move handling fo undefined default value out of camelize functions
Diffstat (limited to 'src/mbgl/style/layers/symbol_layer_impl.cpp')
-rw-r--r--src/mbgl/style/layers/symbol_layer_impl.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mbgl/style/layers/symbol_layer_impl.cpp b/src/mbgl/style/layers/symbol_layer_impl.cpp
index a4dc264ed2..34438285c5 100644
--- a/src/mbgl/style/layers/symbol_layer_impl.cpp
+++ b/src/mbgl/style/layers/symbol_layer_impl.cpp
@@ -45,8 +45,13 @@ std::unique_ptr<Bucket> SymbolLayer::Impl::createBucket(BucketParameters& parame
CalculationParameters p(parameters.tileID.overscaledZ);
bucket->layout.symbolPlacement.calculate(p);
if (bucket->layout.symbolPlacement.value == SymbolPlacementType::Line) {
- bucket->layout.iconRotationAlignment.value = RotationAlignmentType::Map;
- bucket->layout.textRotationAlignment.value = RotationAlignmentType::Map;
+ bucket->layout.iconRotationAlignment.value = AlignmentType::Map;
+ bucket->layout.textRotationAlignment.value = AlignmentType::Map;
+ };
+
+ // If unspecified `text-pitch-alignment` inherits `text-rotation-alignment`
+ if (bucket->layout.textPitchAlignment.value == AlignmentType::Undefined) {
+ bucket->layout.textPitchAlignment.value = bucket->layout.textRotationAlignment.value;
};
bucket->layout.recalculate(p);