diff options
Diffstat (limited to 'src/mbgl/style')
-rw-r--r-- | src/mbgl/style/style.cpp | 15 | ||||
-rw-r--r-- | src/mbgl/style/style.hpp | 2 |
2 files changed, 13 insertions, 4 deletions
diff --git a/src/mbgl/style/style.cpp b/src/mbgl/style/style.cpp index 23536e0e3e..a3c7ce1ad1 100644 --- a/src/mbgl/style/style.cpp +++ b/src/mbgl/style/style.cpp @@ -387,9 +387,8 @@ void Style::recalculate(float z, const TimePoint& timePoint, MapMode mode) { mode == MapMode::Continuous ? util::DEFAULT_FADE_DURATION : Duration::zero() }; - hasPendingTransitions = transitioningLight.hasTransition(); for (const auto& layer : renderLayers) { - hasPendingTransitions |= layer->evaluate(parameters); + layer->evaluate(parameters); if (layer->needsRendering(zoomHistory.lastZoom)) { if (RenderSource* renderSource = getRenderSource(layer->baseImpl.source)) { @@ -443,7 +442,17 @@ RenderSource* Style::getRenderSource(const std::string& id) const { } bool Style::hasTransitions() const { - return hasPendingTransitions; + if (transitioningLight.hasTransition()) { + return true; + } + + for (const auto& layer : renderLayers) { + if (layer->hasTransition()) { + return true; + } + } + + return false; } bool Style::isLoaded() const { diff --git a/src/mbgl/style/style.hpp b/src/mbgl/style/style.hpp index fe588c3ce5..c7528483e9 100644 --- a/src/mbgl/style/style.hpp +++ b/src/mbgl/style/style.hpp @@ -180,9 +180,9 @@ private: UpdateBatch updateBatch; ZoomHistory zoomHistory; - bool hasPendingTransitions = false; void removeRenderLayer(const std::string& layerID); + public: bool loaded = false; }; |