diff options
author | Chris Loer <chris.loer@gmail.com> | 2017-11-09 17:18:37 -0800 |
---|---|---|
committer | Chris Loer <chris.loer@gmail.com> | 2017-11-09 17:18:37 -0800 |
commit | 9adb7351d688b875e5e6d3fe0f39a67bc2eb99b2 (patch) | |
tree | 34403d6b33b022bc146eb50bb443540721e1b28b | |
parent | a9b94e8597ef8dadc24a5492717a36b0408888a2 (diff) | |
download | qtlocation-mapboxgl-9adb7351d688b875e5e6d3fe0f39a67bc2eb99b2.tar.gz |
Fix intermittent render test failures: we can't rely on `renderTile.matrix` being initialized during placement.
-rw-r--r-- | src/mbgl/layout/symbol_projection.cpp | 4 | ||||
-rw-r--r-- | src/mbgl/text/placement.cpp | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/mbgl/layout/symbol_projection.cpp b/src/mbgl/layout/symbol_projection.cpp index fa88ffdf22..b8c399d857 100644 --- a/src/mbgl/layout/symbol_projection.cpp +++ b/src/mbgl/layout/symbol_projection.cpp @@ -187,7 +187,9 @@ namespace mbgl { currentIndex += dir; // offset does not fit on the projected line - if (currentIndex < 0 || currentIndex >= static_cast<int32_t>(line.size())) return {}; + if (currentIndex < 0 || currentIndex >= static_cast<int32_t>(line.size())) { + return {}; + } prev = current; PointAndCameraDistance projection = project(convertPoint<float>(line.at(currentIndex)), labelPlaneMatrix); diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp index ac8c15aae9..b9f270d52e 100644 --- a/src/mbgl/text/placement.cpp +++ b/src/mbgl/text/placement.cpp @@ -62,13 +62,13 @@ void Placement::placeLayer(RenderSymbolLayer& symbolLayer, const mat4& projMatri state.matrixFor(posMatrix, renderTile.id); matrix::multiply(posMatrix, projMatrix, posMatrix); - mat4 textLabelPlaneMatrix = getLabelPlaneMatrix(renderTile.matrix, + mat4 textLabelPlaneMatrix = getLabelPlaneMatrix(posMatrix, layout.get<TextPitchAlignment>() == style::AlignmentType::Map, layout.get<TextRotationAlignment>() == style::AlignmentType::Map, state, pixelsToTileUnits); - mat4 iconLabelPlaneMatrix = getLabelPlaneMatrix(renderTile.matrix, + mat4 iconLabelPlaneMatrix = getLabelPlaneMatrix(posMatrix, layout.get<IconPitchAlignment>() == style::AlignmentType::Map, layout.get<IconRotationAlignment>() == style::AlignmentType::Map, state, |