diff options
Diffstat (limited to 'src/mbgl/renderer/style_diff.cpp')
-rw-r--r-- | src/mbgl/renderer/style_diff.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mbgl/renderer/style_diff.cpp b/src/mbgl/renderer/style_diff.cpp index e2be95432f..e250dfa8d5 100644 --- a/src/mbgl/renderer/style_diff.cpp +++ b/src/mbgl/renderer/style_diff.cpp @@ -27,7 +27,7 @@ StyleDifference<T> diff(const std::vector<T>& a, const std::vector<T>& b, const bIt++; } else { if (aIt->get() != bIt->get()) { - result.changed.emplace((*bIt)->id, *bIt); + result.changed.emplace((*bIt)->id, std::array<T, 2> {{ *aIt, *bIt }}); } aIt++; bIt++; @@ -61,4 +61,13 @@ LayerDifference diffLayers(const std::vector<ImmutableLayer>& a, }); } +bool hasLayoutDifference(const LayerDifference& layerDiff, const std::string& layerID) { + if (layerDiff.added.count(layerID)) + return true; + const auto it = layerDiff.changed.find(layerID); + if (it == layerDiff.changed.end()) + return false; + return it->second[0]->hasLayoutDifference(*it->second[1]); +} + } // namespace mbgl |