summaryrefslogtreecommitdiff
path: root/src/mbgl/text
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-03-22 20:49:38 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2019-03-29 16:18:41 +0200
commit94d8cb4f7f23d829cee48cd9430b3c47c298a7c0 (patch)
treec07680e6fc01f5b93edb9d2939191144be610ae6 /src/mbgl/text
parent9fb149b2613d4f576fffbf28ee45360f847768bc (diff)
downloadqtlocation-mapboxgl-94d8cb4f7f23d829cee48cd9430b3c47c298a7c0.tar.gz
[core] Single line optimization for variable label placement
Diffstat (limited to 'src/mbgl/text')
-rw-r--r--src/mbgl/text/placement.cpp4
-rw-r--r--src/mbgl/text/shaping.cpp1
2 files changed, 2 insertions, 3 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp
index 9d0fcf7b32..f6c4ac1eb6 100644
--- a/src/mbgl/text/placement.cpp
+++ b/src/mbgl/text/placement.cpp
@@ -464,14 +464,14 @@ void Placement::updateBucketOpacities(SymbolBucket& bucket, std::set<uint32_t>&
PlacedSymbol& placed = bucket.text.placedSymbols[*symbolInstance.placedRightTextIndex];
placed.hidden = opacityState.isHidden();
}
- if (symbolInstance.placedCenterTextIndex) {
+ if (symbolInstance.placedCenterTextIndex && !symbolInstance.singleLine) {
for (size_t i = 0; i < symbolInstance.centerJustifiedGlyphQuads.size() * 4; i++) {
bucket.text.opacityVertices.emplace_back(opacityVertex);
}
PlacedSymbol& placed = bucket.text.placedSymbols[*symbolInstance.placedCenterTextIndex];
placed.hidden = opacityState.isHidden();
}
- if (symbolInstance.placedLeftTextIndex) {
+ if (symbolInstance.placedLeftTextIndex && !symbolInstance.singleLine) {
for (size_t i = 0; i < symbolInstance.leftJustifiedGlyphQuads.size() * 4; i++) {
bucket.text.opacityVertices.emplace_back(opacityVertex);
}
diff --git a/src/mbgl/text/shaping.cpp b/src/mbgl/text/shaping.cpp
index 348c2ddccc..ba21b97389 100644
--- a/src/mbgl/text/shaping.cpp
+++ b/src/mbgl/text/shaping.cpp
@@ -363,7 +363,6 @@ const Shaping getShaping(const TaggedString& formattedString,
const style::TextJustifyType textJustify,
const float spacing,
const Point<float>& translate,
- //const float verticalHeight,
const WritingModeType writingMode,
BiDi& bidi,
const GlyphMap& glyphs) {