diff options
Diffstat (limited to 'src/mbgl/style/layers/symbol_layer_impl.cpp')
-rw-r--r-- | src/mbgl/style/layers/symbol_layer_impl.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mbgl/style/layers/symbol_layer_impl.cpp b/src/mbgl/style/layers/symbol_layer_impl.cpp index 3dd1da1136..e35e7b0b9f 100644 --- a/src/mbgl/style/layers/symbol_layer_impl.cpp +++ b/src/mbgl/style/layers/symbol_layer_impl.cpp @@ -1,17 +1,24 @@ #include <mbgl/style/layers/symbol_layer_impl.hpp> - #include <mbgl/util/logging.hpp> namespace mbgl { namespace style { +bool SymbolLayer::Impl::hasFormatSectionOverrides() const { + if (!hasFormatSectionOverrides_) { + hasFormatSectionOverrides_ = SymbolLayerPaintPropertyOverrides::hasOverrides(layout.get<TextField>()); + } + return *hasFormatSectionOverrides_; +} + bool SymbolLayer::Impl::hasLayoutDifference(const Layer::Impl& other) const { assert(other.getTypeInfo() == getTypeInfo()); const auto& impl = static_cast<const style::SymbolLayer::Impl&>(other); return filter != impl.filter || visibility != impl.visibility || layout != impl.layout || - paint.hasDataDrivenPropertyDifference(impl.paint); + paint.hasDataDrivenPropertyDifference(impl.paint) || + (hasFormatSectionOverrides() && SymbolLayerPaintPropertyOverrides::hasPaintPropertyDifference(paint, impl.paint)); } void SymbolLayer::Impl::populateFontStack(std::set<FontStack>& fontStack) const { @@ -20,10 +27,10 @@ void SymbolLayer::Impl::populateFontStack(std::set<FontStack>& fontStack) const } layout.get<TextFont>().match( - [&] (Undefined) { + [&fontStack] (Undefined) { fontStack.insert({"Open Sans Regular", "Arial Unicode MS Regular"}); }, - [&] (const FontStack& constant) { + [&fontStack] (const FontStack& constant) { fontStack.insert(constant); }, [&] (const auto& function) { |