From 45e4938f9e19af8ddd389015d84067eb536da0ca Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 2 Jul 2015 12:31:50 +0200 Subject: [PATCH] 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. --- src/mbgl/renderer/painter_symbol.cpp | 4 +--- src/mbgl/renderer/symbol_bucket.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mbgl/renderer/painter_symbol.cpp b/src/mbgl/renderer/painter_symbol.cpp index 4f4999b3e..6762bcd4d 100644 --- a/src/mbgl/renderer/painter_symbol.cpp +++ b/src/mbgl/renderer/painter_symbol.cpp @@ -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); diff --git a/src/mbgl/renderer/symbol_bucket.cpp b/src/mbgl/renderer/symbol_bucket.cpp index 9f05209ff..d52561d3e 100644 --- a/src/mbgl/renderer/symbol_bucket.cpp +++ b/src/mbgl/renderer/symbol_bucket.cpp @@ -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(); }