summaryrefslogtreecommitdiff
path: root/src/mbgl/layout/symbol_layout.cpp
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2017-10-30 14:10:56 -0700
committerChris Loer <chris.loer@gmail.com>2017-10-31 10:25:57 -0700
commit3fe147c6ec2de6a4221a4d24ce8de2e0ea1415b9 (patch)
treebe7d3e1e55f9b7016e8079c51549285cd64d3910 /src/mbgl/layout/symbol_layout.cpp
parentd2148bd33dc26eb4dd6fca47fb5be98b499526c2 (diff)
downloadqtlocation-mapboxgl-3fe147c6ec2de6a4221a4d24ce8de2e0ea1415b9.tar.gz
Starting on sorting.
Diffstat (limited to 'src/mbgl/layout/symbol_layout.cpp')
-rw-r--r--src/mbgl/layout/symbol_layout.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp
index f74f2fb8b6..925abeb651 100644
--- a/src/mbgl/layout/symbol_layout.cpp
+++ b/src/mbgl/layout/symbol_layout.cpp
@@ -417,7 +417,10 @@ std::vector<float> CalculateTileDistances(const GeometryCoordinates& line, const
}
std::unique_ptr<SymbolBucket> SymbolLayout::place(const bool showCollisionBoxes) {
- auto bucket = std::make_unique<SymbolBucket>(layout, layerPaintProperties, textSize, iconSize, zoom, sdfIcons, iconsNeedLinear, symbolInstances);
+ const bool mayOverlap = layout.get<TextAllowOverlap>() || layout.get<IconAllowOverlap>() ||
+ layout.get<TextIgnorePlacement>() || layout.get<IconIgnorePlacement>();
+
+ auto bucket = std::make_unique<SymbolBucket>(layout, layerPaintProperties, textSize, iconSize, zoom, sdfIcons, iconsNeedLinear, mayOverlap, symbolInstances);
// this iterates over the *bucket's* symbol instances so that it can set the placedsymbol index. TODO cleanup
for (SymbolInstance &symbolInstance : bucket->symbolInstances) {
@@ -502,6 +505,7 @@ void SymbolLayout::addSymbol(Buffer& buffer,
auto& segment = buffer.segments.back();
assert(segment.vertexLength <= std::numeric_limits<uint16_t>::max());
uint16_t index = segment.vertexLength;
+ placedSymbol.vertexStartIndex = index;
// coordinates (2 triangles)
buffer.vertices.emplace_back(SymbolLayoutAttributes::vertex(labelAnchor.point, tl, symbol.glyphOffset.y, tex.x, tex.y, sizeData));