summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layers/symbol_layer_impl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/style/layers/symbol_layer_impl.cpp')
-rw-r--r--src/mbgl/style/layers/symbol_layer_impl.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/mbgl/style/layers/symbol_layer_impl.cpp b/src/mbgl/style/layers/symbol_layer_impl.cpp
index 1039951f5e..e85f3a90f9 100644
--- a/src/mbgl/style/layers/symbol_layer_impl.cpp
+++ b/src/mbgl/style/layers/symbol_layer_impl.cpp
@@ -35,19 +35,29 @@ std::unique_ptr<SymbolLayout> SymbolLayer::Impl::createLayout(BucketParameters&
SymbolLayoutProperties layoutProperties = layout;
CalculationParameters p(parameters.tileID.overscaledZ);
- layoutProperties.symbolPlacement.calculate(p);
- if (layoutProperties.symbolPlacement.value == SymbolPlacementType::Line) {
- layoutProperties.iconRotationAlignment.value = AlignmentType::Map;
- layoutProperties.textRotationAlignment.value = AlignmentType::Map;
+ layoutProperties.recalculate(p);
+
+ if (layoutProperties.iconRotationAlignment.value == AlignmentType::Auto) {
+ if (layoutProperties.symbolPlacement.value == SymbolPlacementType::Line) {
+ layoutProperties.iconRotationAlignment.value = AlignmentType::Map;
+ } else {
+ layoutProperties.iconRotationAlignment.value = AlignmentType::Viewport;
+ }
+ }
+
+ if (layoutProperties.textRotationAlignment.value == AlignmentType::Auto) {
+ if (layoutProperties.symbolPlacement.value == SymbolPlacementType::Line) {
+ layoutProperties.textRotationAlignment.value = AlignmentType::Map;
+ } else {
+ layoutProperties.textRotationAlignment.value = AlignmentType::Viewport;
+ }
}
// If unspecified `text-pitch-alignment` inherits `text-rotation-alignment`
- if (layoutProperties.textPitchAlignment.value == AlignmentType::Undefined) {
+ if (layoutProperties.textPitchAlignment.value == AlignmentType::Auto) {
layoutProperties.textPitchAlignment.value = layoutProperties.textRotationAlignment.value;
}
- layoutProperties.recalculate(p);
-
layoutProperties.textSize.calculate(CalculationParameters(18));
float textMaxSize = layoutProperties.textSize;