From bccba9702077921af35ad31228fccca7ee2b5d04 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 22 May 2014 14:22:54 -0700 Subject: [PATCH 1/2] style cascading needs to happen every render for transitions --- src/map/map.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/map/map.cpp b/src/map/map.cpp index d70821380..0cac0a512 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -438,7 +438,6 @@ void Map::prepare() { bool pixelRatioChanged = oldState.getPixelRatio() != state.getPixelRatio(); bool dimensionsChanged = oldState.getFramebufferWidth() != state.getFramebufferWidth() || oldState.getFramebufferHeight() != state.getFramebufferHeight(); - bool zoomChanged = oldState.getNormalizedZoom() != state.getNormalizedZoom(); if (pixelRatioChanged) { // We have a pixelratio change @@ -452,9 +451,7 @@ void Map::prepare() { painter.clearFramebuffers(); } - if (zoomChanged) { - style.cascade(state.getNormalizedZoom()); - } + style.cascade(state.getNormalizedZoom()); animationTime = util::now(); if (style.needsTransition()) { From 12594ce8f1c69061f477c50604b21a3211e5dd72 Mon Sep 17 00:00:00 2001 From: "Justin R. Miller" Date: Thu, 22 May 2014 14:24:54 -0700 Subject: [PATCH 2/2] clearer comments --- src/map/map.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/map/map.cpp b/src/map/map.cpp index 0cac0a512..3c0fbbcbb 100644 --- a/src/map/map.cpp +++ b/src/map/map.cpp @@ -425,13 +425,12 @@ void Map::updateRenderState() { void Map::prepare() { view.make_active(); - // Update transitions + // Update transform transitions. animationTime = util::now(); if (transform.needsTransition()) { transform.updateTransitions(animationTime); } - const TransformState oldState = state; state = transform.currentState(); @@ -440,7 +439,6 @@ void Map::prepare() { oldState.getFramebufferHeight() != state.getFramebufferHeight(); if (pixelRatioChanged) { - // We have a pixelratio change style.sprite = std::make_shared(*this, state.getPixelRatio()); style.sprite->load(kSpriteURL); @@ -453,6 +451,7 @@ void Map::prepare() { style.cascade(state.getNormalizedZoom()); + // Update style transitions. animationTime = util::now(); if (style.needsTransition()) { style.updateTransitions(animationTime);