summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Morris <michael.patrick.morris@gmail.com>2015-11-02 18:00:15 -0500
committerMike Morris <michael.patrick.morris@gmail.com>2015-11-02 18:26:09 -0500
commitba7cc755e74006b14b46b13b65a100a519e402f3 (patch)
tree2cc50aab0f964de0d17b1978c1291ab81e1a0388
parent9b31fdf13db762090a386a1f41ffe7fe96f933fe (diff)
downloadqtlocation-mapboxgl-ba7cc755e74006b14b46b13b65a100a519e402f3.tar.gz
[node] patch Painter::renderSDF to ignore animation and fade duration in MapMode::Still
-rw-r--r--src/mbgl/renderer/painter_symbol.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mbgl/renderer/painter_symbol.cpp b/src/mbgl/renderer/painter_symbol.cpp
index 1ad8c64e8d..f0a0d1904b 100644
--- a/src/mbgl/renderer/painter_symbol.cpp
+++ b/src/mbgl/renderer/painter_symbol.cpp
@@ -67,11 +67,18 @@ void Painter::renderSDF(SymbolBucket &bucket,
sdfShader.u_zoom = (state.getNormalizedZoom() - zoomAdjust) * 10; // current zoom level
- FadeProperties f = frameHistory.getFadeProperties(data.getAnimationTime(), data.getDefaultFadeDuration());
- sdfShader.u_fadedist = f.fadedist * 10;
- sdfShader.u_minfadezoom = std::floor(f.minfadezoom * 10);
- sdfShader.u_maxfadezoom = std::floor(f.maxfadezoom * 10);
- sdfShader.u_fadezoom = (state.getNormalizedZoom() + f.bump) * 10;
+ if (data.mode == MapMode::Continuous) {
+ FadeProperties f = frameHistory.getFadeProperties(data.getAnimationTime(), data.getDefaultFadeDuration());
+ sdfShader.u_fadedist = f.fadedist * 10;
+ sdfShader.u_minfadezoom = std::floor(f.minfadezoom * 10);
+ sdfShader.u_maxfadezoom = std::floor(f.maxfadezoom * 10);
+ sdfShader.u_fadezoom = (state.getNormalizedZoom() + f.bump) * 10;
+ } else { // MapMode::Still
+ sdfShader.u_fadedist = 0;
+ sdfShader.u_minfadezoom = state.getNormalizedZoom() * 10;
+ sdfShader.u_maxfadezoom = state.getNormalizedZoom() * 10;
+ sdfShader.u_fadezoom = state.getNormalizedZoom() * 10;
+ }
// The default gamma value has to be adjust for the current pixelratio so that we're not
// drawing blurry font on retina screens.