summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-06-13 12:28:25 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-06-13 13:16:47 +0300
commitbfcd21dd7e1531466be365447bb9a9630ed20d31 (patch)
tree6ece80d4eff871e48411b7d578912b53af327da4
parent2bdecdf9f9a93c30f7d482f9993c47b86a9f5eb8 (diff)
downloadqtlocation-mapboxgl-bfcd21dd7e1531466be365447bb9a9630ed20d31.tar.gz
[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.
-rw-r--r--package.json4
-rw-r--r--src/mbgl/renderer/painter_line.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/package.json b/package.json
index 29246d7bed..8bebceeb54 100644
--- a/package.json
+++ b/package.json
@@ -21,9 +21,9 @@
"csscolorparser": "^1.0.2",
"ejs": "^2.4.1",
"express": "^4.11.1",
- "mapbox-gl-shaders": "mapbox/mapbox-gl-shaders#30caf388dbddd02cfc4f967ffc94c1338c30fbf8",
+ "mapbox-gl-shaders": "mapbox/mapbox-gl-shaders#09ee512cd59a8fb1a241c78833b7c8022bf4f263",
"mapbox-gl-style-spec": "mapbox/mapbox-gl-style-spec#2461efc3d883f2f2e56a6c6b2bfd7d54bbfe9f86",
- "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#64cf15b657e12b070fede3f2fd3f5ac4fc096e5b",
+ "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#e78f09dce98080a9a6fa436d11fdf6fc2f271d7a",
"node-gyp": "^3.3.1",
"request": "^2.72.0",
"tape": "^4.5.1"
diff --git a/src/mbgl/renderer/painter_line.cpp b/src/mbgl/renderer/painter_line.cpp
index 26041a8165..199fb49a58 100644
--- a/src/mbgl/renderer/painter_line.cpp
+++ b/src/mbgl/renderer/painter_line.cpp
@@ -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);