Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 804e860

Browse files
committedAug 31, 2016
[core] Fix default text pitch alignment
When text-pitch-alignment is unspecified, only use the explicit value of text-rotation-alignment. If text-rotation-alignment is unspecified, back to the style specification default for text-pitch-alignment rather than text-rotation-alignment. Fixes #5683.
1 parent c075386 commit 804e860

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/mbgl/style/layers/symbol_layer_impl.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,15 @@ std::unique_ptr<Bucket> SymbolLayer::Impl::createBucket(BucketParameters& parame
3636

3737
CalculationParameters p(parameters.tileID.overscaledZ);
3838
bucket->layout.symbolPlacement.calculate(p);
39+
auto textPitchAlignmentFallback = bucket->layout.textRotationAlignment.value;
3940
if (bucket->layout.symbolPlacement.value == SymbolPlacementType::Line) {
4041
bucket->layout.iconRotationAlignment.value = AlignmentType::Map;
4142
bucket->layout.textRotationAlignment.value = AlignmentType::Map;
4243
};
4344

4445
// If unspecified `text-pitch-alignment` inherits `text-rotation-alignment`
4546
if (bucket->layout.textPitchAlignment.value == AlignmentType::Undefined) {
46-
bucket->layout.textPitchAlignment.value = bucket->layout.textRotationAlignment.value;
47+
bucket->layout.textPitchAlignment.value = textPitchAlignmentFallback;
4748
};
4849

4950
bucket->layout.recalculate(p);

0 commit comments

Comments
 (0)
This repository has been archived.