From a8ef2af353de195648578bf0d753703cb6f34905 Mon Sep 17 00:00:00 2001 From: Lauren Budorick Date: Wed, 26 Jul 2017 13:18:47 -0700 Subject: [core][android][macos][ios] Implement property functions for line-join, text-justify, text-anchor (#9583) --- src/mbgl/style/layers/line_layer.cpp | 6 +++--- src/mbgl/style/layers/line_layer_properties.hpp | 2 +- src/mbgl/style/layers/symbol_layer.cpp | 12 ++++++------ src/mbgl/style/layers/symbol_layer_properties.hpp | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/mbgl/style/layers') diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp index 6fbdf19568..1c7f0d28ee 100644 --- a/src/mbgl/style/layers/line_layer.cpp +++ b/src/mbgl/style/layers/line_layer.cpp @@ -108,15 +108,15 @@ void LineLayer::setLineCap(PropertyValue value) { baseImpl = std::move(impl_); observer->onLayerChanged(*this); } -PropertyValue LineLayer::getDefaultLineJoin() { +DataDrivenPropertyValue LineLayer::getDefaultLineJoin() { return LineJoin::defaultValue(); } -PropertyValue LineLayer::getLineJoin() const { +DataDrivenPropertyValue LineLayer::getLineJoin() const { return impl().layout.get(); } -void LineLayer::setLineJoin(PropertyValue value) { +void LineLayer::setLineJoin(DataDrivenPropertyValue value) { if (value == getLineJoin()) return; auto impl_ = mutableImpl(); diff --git a/src/mbgl/style/layers/line_layer_properties.hpp b/src/mbgl/style/layers/line_layer_properties.hpp index b2c7f3199c..aeaf51698a 100644 --- a/src/mbgl/style/layers/line_layer_properties.hpp +++ b/src/mbgl/style/layers/line_layer_properties.hpp @@ -17,7 +17,7 @@ struct LineCap : LayoutProperty { static LineCapType defaultValue() { return LineCapType::Butt; } }; -struct LineJoin : LayoutProperty { +struct LineJoin : DataDrivenLayoutProperty { static constexpr const char * key = "line-join"; static LineJoinType defaultValue() { return LineJoinType::Miter; } }; diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp index c102c64a94..803ae7397e 100644 --- a/src/mbgl/style/layers/symbol_layer.cpp +++ b/src/mbgl/style/layers/symbol_layer.cpp @@ -476,15 +476,15 @@ void SymbolLayer::setTextLetterSpacing(PropertyValue value) { baseImpl = std::move(impl_); observer->onLayerChanged(*this); } -PropertyValue SymbolLayer::getDefaultTextJustify() { +DataDrivenPropertyValue SymbolLayer::getDefaultTextJustify() { return TextJustify::defaultValue(); } -PropertyValue SymbolLayer::getTextJustify() const { +DataDrivenPropertyValue SymbolLayer::getTextJustify() const { return impl().layout.get(); } -void SymbolLayer::setTextJustify(PropertyValue value) { +void SymbolLayer::setTextJustify(DataDrivenPropertyValue value) { if (value == getTextJustify()) return; auto impl_ = mutableImpl(); @@ -492,15 +492,15 @@ void SymbolLayer::setTextJustify(PropertyValue value) { baseImpl = std::move(impl_); observer->onLayerChanged(*this); } -PropertyValue SymbolLayer::getDefaultTextAnchor() { +DataDrivenPropertyValue SymbolLayer::getDefaultTextAnchor() { return TextAnchor::defaultValue(); } -PropertyValue SymbolLayer::getTextAnchor() const { +DataDrivenPropertyValue SymbolLayer::getTextAnchor() const { return impl().layout.get(); } -void SymbolLayer::setTextAnchor(PropertyValue value) { +void SymbolLayer::setTextAnchor(DataDrivenPropertyValue value) { if (value == getTextAnchor()) return; auto impl_ = mutableImpl(); diff --git a/src/mbgl/style/layers/symbol_layer_properties.hpp b/src/mbgl/style/layers/symbol_layer_properties.hpp index 4b2bff01b8..fe6ab38e92 100644 --- a/src/mbgl/style/layers/symbol_layer_properties.hpp +++ b/src/mbgl/style/layers/symbol_layer_properties.hpp @@ -132,12 +132,12 @@ struct TextLetterSpacing : LayoutProperty { static float defaultValue() { return 0; } }; -struct TextJustify : LayoutProperty { +struct TextJustify : DataDrivenLayoutProperty { static constexpr const char * key = "text-justify"; static TextJustifyType defaultValue() { return TextJustifyType::Center; } }; -struct TextAnchor : LayoutProperty { +struct TextAnchor : DataDrivenLayoutProperty { static constexpr const char * key = "text-anchor"; static TextAnchorType defaultValue() { return TextAnchorType::Center; } }; -- cgit v1.2.1