fix cross-tile label collisions

fix #1816
fix #1689

The missing label was the only one in it's bucket. Since the label was
outside the tile boundaries it wouldn't need to be drawn by the bucket.
Since the bucket had no features to draw, it was dropped completely.
Even if a bucket doesn't have any features that need to be rendered, it
may have features that need to impact the placement of features in other
layers.
This commit is contained in:
Ansis Brammanis
2015-07-02 12:31:50 +02:00
parent 4a44b70407
commit 45e4938f9e
2 changed files with 2 additions and 4 deletions

View File

@@ -122,9 +122,7 @@ void Painter::renderSymbol(SymbolBucket &bucket, const StyleLayer &layer_desc, c
config.depthTest = true;
config.depthMask = GL_FALSE;
if (bucket.hasCollisionBoxData() && (
(bucket.hasIconData() && properties.icon.opacity) ||
(bucket.hasTextData() && properties.text.opacity))) {
if (bucket.hasCollisionBoxData()) {
config.stencilTest = true;
useProgram(collisionBoxShader->program);

View File

@@ -80,7 +80,7 @@ void SymbolBucket::render(Painter& painter,
painter.renderSymbol(*this, layer_desc, id, matrix);
}
bool SymbolBucket::hasData() const { return hasTextData() || hasIconData(); }
bool SymbolBucket::hasData() const { return hasTextData() || hasIconData() || symbolInstances.size(); }
bool SymbolBucket::hasTextData() const { return renderData && !renderData->text.groups.empty(); }