diff options
Diffstat (limited to 'src/style/property_fallback.cpp')
-rw-r--r-- | src/style/property_fallback.cpp | 92 |
1 files changed, 52 insertions, 40 deletions
diff --git a/src/style/property_fallback.cpp b/src/style/property_fallback.cpp index 949dc1a5cb..4401c8105a 100644 --- a/src/style/property_fallback.cpp +++ b/src/style/property_fallback.cpp @@ -1,48 +1,60 @@ #include <mbgl/style/property_fallback.hpp> +#include <mbgl/style/style_properties.hpp> namespace mbgl { const std::map<PropertyKey, PropertyValue> PropertyFallbackValue::properties = { - { PropertyKey::FillAntialias, true }, - { PropertyKey::FillOpacity, 1.0f }, - { PropertyKey::FillColor, Color({{ 0, 0, 0, 1 }}) }, - { PropertyKey::FillTranslateX, 0.0f }, - { PropertyKey::FillTranslateY, 0.0f }, - { PropertyKey::FillTranslateAnchor, TranslateAnchorType::Map }, - - { PropertyKey::LineOpacity, 1.0f }, - { PropertyKey::LineColor, Color({{ 0, 0, 0, 1 }}) }, - { PropertyKey::LineTranslateX, 0.0f }, - { PropertyKey::LineTranslateY, 0.0f }, - { PropertyKey::LineTranslateAnchor, TranslateAnchorType::Map }, - { PropertyKey::LineWidth, 1.0f }, - { PropertyKey::LineOffset, 0.0f }, - { PropertyKey::LineBlur, 1.0f }, - { PropertyKey::LineDashLand, 1.0f }, - { PropertyKey::LineDashGap, -1.0f }, - - { PropertyKey::IconOpacity, 1.0f }, - { PropertyKey::IconRotate, 0.0f }, - { PropertyKey::IconRotateAnchor, RotateAnchorType::Viewport }, - - { PropertyKey::TextOpacity, 1.0f }, - { PropertyKey::TextSize, 16.0f }, - { PropertyKey::TextColor, Color({{ 0, 0, 0, 1 }}) }, - { PropertyKey::TextHaloColor, Color({{ 0, 0, 0, 0 }}) }, - { PropertyKey::TextHaloWidth, 0.25f }, - { PropertyKey::TextHaloBlur, 1.0f }, - - { PropertyKey::CompositeOpacity, 1.0f }, - - { PropertyKey::RasterOpacity, 1.0f }, - { PropertyKey::RasterSpin, 0.0f }, - { PropertyKey::RasterBrightnessLow, 0.0f }, - { PropertyKey::RasterBrightnessHigh, 1.0f }, - { PropertyKey::RasterSaturation, 0.0f }, - { PropertyKey::RasterContrast, 0.0f }, - { PropertyKey::RasterFade, 0.0f }, - - { PropertyKey::BackgroundColor, Color({{ 0, 0, 0, 0 }}) }, + { PropertyKey::FillAntialias, defaultStyleProperties<FillProperties>().antialias }, + { PropertyKey::FillOpacity, defaultStyleProperties<FillProperties>().opacity }, + { PropertyKey::FillColor, defaultStyleProperties<FillProperties>().fill_color }, + // no FillOutlineColor on purpose. + { PropertyKey::FillTranslateX, defaultStyleProperties<FillProperties>().translate[0] }, + { PropertyKey::FillTranslateY, defaultStyleProperties<FillProperties>().translate[1] }, + { PropertyKey::FillTranslateAnchor, defaultStyleProperties<FillProperties>().translateAnchor }, + + { PropertyKey::LineOpacity, defaultStyleProperties<LineProperties>().opacity }, + { PropertyKey::LineColor, defaultStyleProperties<LineProperties>().color }, + { PropertyKey::LineTranslateX, defaultStyleProperties<LineProperties>().translate[0] }, + { PropertyKey::LineTranslateY, defaultStyleProperties<LineProperties>().translate[1] }, + { PropertyKey::LineTranslateAnchor, defaultStyleProperties<LineProperties>().translateAnchor }, + { PropertyKey::LineWidth, defaultStyleProperties<LineProperties>().width }, + { PropertyKey::LineOffset, defaultStyleProperties<LineProperties>().offset }, + { PropertyKey::LineBlur, defaultStyleProperties<LineProperties>().blur }, + { PropertyKey::LineDashLand, defaultStyleProperties<LineProperties>().dash_array[0] }, + { PropertyKey::LineDashGap, defaultStyleProperties<LineProperties>().dash_array[1] }, + + { PropertyKey::IconOpacity, defaultStyleProperties<SymbolProperties>().icon.opacity }, + { PropertyKey::IconRotate, defaultStyleProperties<SymbolProperties>().icon.rotate }, + { PropertyKey::IconSize, defaultStyleProperties<SymbolProperties>().icon.size }, + { PropertyKey::IconColor, defaultStyleProperties<SymbolProperties>().icon.color }, + { PropertyKey::IconHaloColor, defaultStyleProperties<SymbolProperties>().icon.halo_color }, + { PropertyKey::IconHaloWidth, defaultStyleProperties<SymbolProperties>().icon.halo_width }, + { PropertyKey::IconHaloBlur, defaultStyleProperties<SymbolProperties>().icon.halo_blur }, + { PropertyKey::IconTranslateX, defaultStyleProperties<SymbolProperties>().icon.translate[0] }, + { PropertyKey::IconTranslateY, defaultStyleProperties<SymbolProperties>().icon.translate[1] }, + { PropertyKey::IconTranslateAnchor, defaultStyleProperties<SymbolProperties>().icon.translate_anchor }, + + { PropertyKey::TextOpacity, defaultStyleProperties<SymbolProperties>().text.opacity }, + { PropertyKey::TextSize, defaultStyleProperties<SymbolProperties>().text.size }, + { PropertyKey::TextColor, defaultStyleProperties<SymbolProperties>().text.color }, + { PropertyKey::TextHaloColor, defaultStyleProperties<SymbolProperties>().text.halo_color }, + { PropertyKey::TextHaloWidth, defaultStyleProperties<SymbolProperties>().text.halo_width }, + { PropertyKey::TextHaloBlur, defaultStyleProperties<SymbolProperties>().text.halo_blur }, + { PropertyKey::TextTranslateX, defaultStyleProperties<SymbolProperties>().text.translate[0] }, + { PropertyKey::TextTranslateY, defaultStyleProperties<SymbolProperties>().text.translate[1] }, + { PropertyKey::TextTranslateAnchor, defaultStyleProperties<SymbolProperties>().text.translate_anchor }, + + { PropertyKey::CompositeOpacity, defaultStyleProperties<CompositeProperties>().opacity }, + + { PropertyKey::RasterOpacity, defaultStyleProperties<RasterProperties>().opacity }, + { PropertyKey::RasterSpin, defaultStyleProperties<RasterProperties>().spin }, + { PropertyKey::RasterBrightnessLow, defaultStyleProperties<RasterProperties>().brightness[0] }, + { PropertyKey::RasterBrightnessHigh, defaultStyleProperties<RasterProperties>().brightness[1] }, + { PropertyKey::RasterSaturation, defaultStyleProperties<RasterProperties>().saturation }, + { PropertyKey::RasterContrast, defaultStyleProperties<RasterProperties>().contrast }, + { PropertyKey::RasterFade, defaultStyleProperties<RasterProperties>().fade }, + + { PropertyKey::BackgroundColor, defaultStyleProperties<BackgroundProperties>().color }, }; const PropertyValue PropertyFallbackValue::defaultProperty = false; |