[core] Update line-pattern shader code/tests

Refs:
- mapbox-gl-test-suite: https://github.com/mapbox/mapbox-gl-test-suite/pull/107
- mapbox-gl-shaders: https://github.com/mapbox/mapbox-gl-shaders/pull/17
- mapbox-gl-js: https://github.com/mapbox/mapbox-gl-js/pull/2724

Part of https://github.com/mapbox/mapbox-gl-shaders/issues/1.
This commit is contained in:
Bruno de Oliveira Abinader
2016-06-13 12:28:25 +03:00
parent 2bdecdf9f9
commit bfcd21dd7e
2 changed files with 4 additions and 4 deletions

View File

@@ -53,9 +53,9 @@ void Painter::renderLine(LineBucket& bucket,
// calculate how much longer the real world distance is at the top of the screen
// than at the middle of the screen.
float topedgelength = std::sqrt(std::pow(state.getHeight(), 2) / 4 * (1 + std::pow(state.getAltitude(), 2)));
float topedgelength = std::sqrt(std::pow(state.getHeight(), 2.0f) / 4.0f * (1.0f + std::pow(state.getAltitude(), 2.0f)));
float x = state.getHeight() / 2.0f * std::tan(state.getPitch());
float extra = (topedgelength + x) / topedgelength - 1;
float extra = (topedgelength + x) / topedgelength - 1.0f;
mat4 vtxMatrix =
translatedMatrix(matrix, properties.lineTranslate, tileID, properties.lineTranslateAnchor);