diff options
author | Lauren Budorick <lauren@mapbox.com> | 2017-06-19 14:27:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-19 14:27:43 -0700 |
commit | 87a70c47930d79017816b8ac7ae1bb06eb6446c9 (patch) | |
tree | 721d9c995573d1f7ce755a75f64aa088eb43a3c2 /src/mbgl/style | |
parent | a33cad98557f2d15bfb578e4795b130d25a2def2 (diff) | |
download | qtlocation-mapboxgl-87a70c47930d79017816b8ac7ae1bb06eb6446c9.tar.gz |
[core] Enable property functions for line-width (#9250)
Diffstat (limited to 'src/mbgl/style')
-rw-r--r-- | src/mbgl/style/layers/line_layer.cpp | 6 | ||||
-rw-r--r-- | src/mbgl/style/layers/line_layer_properties.hpp | 2 | ||||
-rw-r--r-- | src/mbgl/style/properties.hpp | 13 |
3 files changed, 16 insertions, 5 deletions
diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp index cf3f81f613..6fbdf19568 100644 --- a/src/mbgl/style/layers/line_layer.cpp +++ b/src/mbgl/style/layers/line_layer.cpp @@ -267,15 +267,15 @@ TransitionOptions LineLayer::getLineTranslateAnchorTransition() const { return impl().paint.template get<LineTranslateAnchor>().options; } -PropertyValue<float> LineLayer::getDefaultLineWidth() { +DataDrivenPropertyValue<float> LineLayer::getDefaultLineWidth() { return { 1 }; } -PropertyValue<float> LineLayer::getLineWidth() const { +DataDrivenPropertyValue<float> LineLayer::getLineWidth() const { return impl().paint.template get<LineWidth>().value; } -void LineLayer::setLineWidth(PropertyValue<float> value) { +void LineLayer::setLineWidth(DataDrivenPropertyValue<float> value) { if (value == getLineWidth()) 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 7930ed113b..b2c7f3199c 100644 --- a/src/mbgl/style/layers/line_layer_properties.hpp +++ b/src/mbgl/style/layers/line_layer_properties.hpp @@ -48,7 +48,7 @@ struct LineTranslateAnchor : PaintProperty<TranslateAnchorType> { static TranslateAnchorType defaultValue() { return TranslateAnchorType::Map; } }; -struct LineWidth : PaintProperty<float> { +struct LineWidth : DataDrivenPaintProperty<float, attributes::a_width, uniforms::u_width> { static float defaultValue() { return 1; } }; diff --git a/src/mbgl/style/properties.hpp b/src/mbgl/style/properties.hpp index 24ac030541..e42beac97a 100644 --- a/src/mbgl/style/properties.hpp +++ b/src/mbgl/style/properties.hpp @@ -130,7 +130,10 @@ public: class PossiblyEvaluated : public Tuple<PossiblyEvaluatedTypes> { public: - using Tuple<PossiblyEvaluatedTypes>::Tuple; + template <class... Us> + PossiblyEvaluated(Us&&... us) + : Tuple<PossiblyEvaluatedTypes>(std::forward<Us>(us)...) { + } template <class T> static T evaluate(float, const GeometryTileFeature&, const T& t, const T&) { @@ -214,5 +217,13 @@ public: }; }; +template <class...> +struct ConcatenateProperties; + +template <class... As, class... Bs> +struct ConcatenateProperties<TypeList<As...>, TypeList<Bs...>> { + using Type = Properties<As..., Bs...>; +}; + } // namespace style } // namespace mbgl |