diff --git a/include/mbgl/style/style_properties.hpp b/include/mbgl/style/style_properties.hpp index c7606be25..0414ac047 100644 --- a/include/mbgl/style/style_properties.hpp +++ b/include/mbgl/style/style_properties.hpp @@ -94,7 +94,7 @@ struct RasterProperties { struct BackgroundProperties { inline BackgroundProperties() {} - Color color = {{ 1, 1, 1, 1 }}; + Color color = {{ 0, 0, 0, 1 }}; }; typedef util::variant< diff --git a/src/style/property_fallback.cpp b/src/style/property_fallback.cpp index 949dc1a5c..78e6fc863 100644 --- a/src/style/property_fallback.cpp +++ b/src/style/property_fallback.cpp @@ -1,48 +1,50 @@ #include +#include namespace mbgl { const std::map 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::FillAntialias, defaultStyleProperties().antialias }, + { PropertyKey::FillOpacity, defaultStyleProperties().opacity }, + { PropertyKey::FillColor, defaultStyleProperties().fill_color }, + // no FillOutlineColor on purpose. + { PropertyKey::FillTranslateX, defaultStyleProperties().translate[0] }, + { PropertyKey::FillTranslateY, defaultStyleProperties().translate[1] }, + { PropertyKey::FillTranslateAnchor, defaultStyleProperties().translateAnchor }, - { 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::LineOpacity, defaultStyleProperties().opacity }, + { PropertyKey::LineColor, defaultStyleProperties().color }, + { PropertyKey::LineTranslateX, defaultStyleProperties().translate[0] }, + { PropertyKey::LineTranslateY, defaultStyleProperties().translate[1] }, + { PropertyKey::LineTranslateAnchor, defaultStyleProperties().translateAnchor }, + { PropertyKey::LineWidth, defaultStyleProperties().width }, + { PropertyKey::LineOffset, defaultStyleProperties().offset }, + { PropertyKey::LineBlur, defaultStyleProperties().blur }, + { PropertyKey::LineDashLand, defaultStyleProperties().dash_array[0] }, + { PropertyKey::LineDashGap, defaultStyleProperties().dash_array[1] }, - { PropertyKey::IconOpacity, 1.0f }, - { PropertyKey::IconRotate, 0.0f }, - { PropertyKey::IconRotateAnchor, RotateAnchorType::Viewport }, + { PropertyKey::IconOpacity, defaultStyleProperties().opacity }, + { PropertyKey::IconRotate, defaultStyleProperties().rotate }, + { PropertyKey::IconRotateAnchor, defaultStyleProperties().rotate_anchor }, - { 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::TextOpacity, defaultStyleProperties().opacity }, + { PropertyKey::TextSize, defaultStyleProperties().size }, + { PropertyKey::TextColor, defaultStyleProperties().color }, + { PropertyKey::TextHaloColor, defaultStyleProperties().halo_color }, + { PropertyKey::TextHaloWidth, defaultStyleProperties().halo_width }, + { PropertyKey::TextHaloBlur, defaultStyleProperties().halo_blur }, - { PropertyKey::CompositeOpacity, 1.0f }, + { PropertyKey::CompositeOpacity, defaultStyleProperties().opacity }, - { 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::RasterOpacity, defaultStyleProperties().opacity }, + { PropertyKey::RasterSpin, defaultStyleProperties().spin }, + { PropertyKey::RasterBrightnessLow, defaultStyleProperties().brightness[0] }, + { PropertyKey::RasterBrightnessHigh, defaultStyleProperties().brightness[1] }, + { PropertyKey::RasterSaturation, defaultStyleProperties().saturation }, + { PropertyKey::RasterContrast, defaultStyleProperties().contrast }, + { PropertyKey::RasterFade, defaultStyleProperties().fade }, - { PropertyKey::BackgroundColor, Color({{ 0, 0, 0, 0 }}) }, + { PropertyKey::BackgroundColor, defaultStyleProperties().color }, }; const PropertyValue PropertyFallbackValue::defaultProperty = false;