Bump GL-JS

Backport GL-JS fix 'Hide glyphs behind the camera'(https://github.com/mapbox/mapbox-gl-js/pull/9229)
This commit is contained in:
zmiao
2020-02-10 23:27:07 +02:00
parent e0b1642825
commit 7424c4eecb
10 changed files with 486 additions and 433 deletions

View File

@@ -410,8 +410,16 @@ namespace mbgl {
const float pitchScaledFontSize = pitchWithMap ?
fontSize * perspectiveRatio :
fontSize / perspectiveRatio;
const Point<float> anchorPoint = project(placedSymbol.anchorPoint, labelPlaneMatrix).first;
const auto transformedTileAnchor = project(placedSymbol.anchorPoint, labelPlaneMatrix);
// Skip labels behind the camera
if (transformedTileAnchor.second <= 0.0) {
hideGlyphs(placedSymbol.glyphOffsets.size(), dynamicVertexArray);
continue;
}
const Point<float> anchorPoint = transformedTileAnchor.first;
PlacementResult placeUnflipped = placeGlyphsAlongLine(placedSymbol, pitchScaledFontSize, false /*unflipped*/, keepUpright, posMatrix, labelPlaneMatrix, glCoordMatrix, dynamicVertexArray, anchorPoint, state.getSize().aspectRatio());