summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLauren Budorick <lauren@mapbox.com>2017-06-19 14:27:43 -0700
committerGitHub <noreply@github.com>2017-06-19 14:27:43 -0700
commit87a70c47930d79017816b8ac7ae1bb06eb6446c9 (patch)
tree721d9c995573d1f7ce755a75f64aa088eb43a3c2 /include
parenta33cad98557f2d15bfb578e4795b130d25a2def2 (diff)
downloadqtlocation-mapboxgl-87a70c47930d79017816b8ac7ae1bb06eb6446c9.tar.gz
[core] Enable property functions for line-width (#9250)
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/annotation/annotation.hpp2
-rw-r--r--include/mbgl/style/conversion/make_property_setters.hpp2
-rw-r--r--include/mbgl/style/data_driven_property_value.hpp2
-rw-r--r--include/mbgl/style/function/camera_function.hpp1
-rw-r--r--include/mbgl/style/function/composite_function.hpp1
-rw-r--r--include/mbgl/style/function/source_function.hpp1
-rw-r--r--include/mbgl/style/layers/line_layer.hpp6
7 files changed, 9 insertions, 6 deletions
diff --git a/include/mbgl/annotation/annotation.hpp b/include/mbgl/annotation/annotation.hpp
index 2a938fb755..96e06ca222 100644
--- a/include/mbgl/annotation/annotation.hpp
+++ b/include/mbgl/annotation/annotation.hpp
@@ -31,7 +31,7 @@ class LineAnnotation {
public:
ShapeAnnotationGeometry geometry;
style::DataDrivenPropertyValue<float> opacity { 1.0f };
- style::PropertyValue<float> width { 1.0f };
+ style::DataDrivenPropertyValue<float> width { 1.0f };
style::DataDrivenPropertyValue<Color> color { Color::black() };
};
diff --git a/include/mbgl/style/conversion/make_property_setters.hpp b/include/mbgl/style/conversion/make_property_setters.hpp
index 582ac7079f..eaea2e89dc 100644
--- a/include/mbgl/style/conversion/make_property_setters.hpp
+++ b/include/mbgl/style/conversion/make_property_setters.hpp
@@ -99,7 +99,7 @@ auto makePaintPropertySetters() {
result["line-translate-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineTranslateTransition>;
result["line-translate-anchor"] = &setProperty<V, LineLayer, PropertyValue<TranslateAnchorType>, &LineLayer::setLineTranslateAnchor>;
result["line-translate-anchor-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineTranslateAnchorTransition>;
- result["line-width"] = &setProperty<V, LineLayer, PropertyValue<float>, &LineLayer::setLineWidth>;
+ result["line-width"] = &setProperty<V, LineLayer, DataDrivenPropertyValue<float>, &LineLayer::setLineWidth>;
result["line-width-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineWidthTransition>;
result["line-gap-width"] = &setProperty<V, LineLayer, DataDrivenPropertyValue<float>, &LineLayer::setLineGapWidth>;
result["line-gap-width-transition"] = &setTransition<V, LineLayer, &LineLayer::setLineGapWidthTransition>;
diff --git a/include/mbgl/style/data_driven_property_value.hpp b/include/mbgl/style/data_driven_property_value.hpp
index 090ee0f59b..5d7c596363 100644
--- a/include/mbgl/style/data_driven_property_value.hpp
+++ b/include/mbgl/style/data_driven_property_value.hpp
@@ -49,7 +49,7 @@ public:
bool isZoomConstant() const {
return !value.template is<CameraFunction<T>>() && !value.template is<CompositeFunction<T>>();
}
-
+
template <class... Ts>
auto match(Ts&&... ts) const {
return value.match(std::forward<Ts>(ts)...);
diff --git a/include/mbgl/style/function/camera_function.hpp b/include/mbgl/style/function/camera_function.hpp
index 1b03cc8cf6..0fd5bcb078 100644
--- a/include/mbgl/style/function/camera_function.hpp
+++ b/include/mbgl/style/function/camera_function.hpp
@@ -35,6 +35,7 @@ public:
}
Stops stops;
+ bool useIntegerZoom = false;
};
} // namespace style
diff --git a/include/mbgl/style/function/composite_function.hpp b/include/mbgl/style/function/composite_function.hpp
index c3de0726c0..43599cd333 100644
--- a/include/mbgl/style/function/composite_function.hpp
+++ b/include/mbgl/style/function/composite_function.hpp
@@ -135,6 +135,7 @@ public:
std::string property;
Stops stops;
optional<T> defaultValue;
+ bool useIntegerZoom = false;
private:
T evaluateFinal(const CoveringRanges& ranges, const Value& value, T finalDefaultValue) const {
diff --git a/include/mbgl/style/function/source_function.hpp b/include/mbgl/style/function/source_function.hpp
index f6601d9ea3..2872c63a64 100644
--- a/include/mbgl/style/function/source_function.hpp
+++ b/include/mbgl/style/function/source_function.hpp
@@ -53,6 +53,7 @@ public:
std::string property;
Stops stops;
optional<T> defaultValue;
+ bool useIntegerZoom = false;
};
} // namespace style
diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp
index c643ad110d..0b49690fd8 100644
--- a/include/mbgl/style/layers/line_layer.hpp
+++ b/include/mbgl/style/layers/line_layer.hpp
@@ -80,9 +80,9 @@ public:
void setLineTranslateAnchorTransition(const TransitionOptions&);
TransitionOptions getLineTranslateAnchorTransition() const;
- static PropertyValue<float> getDefaultLineWidth();
- PropertyValue<float> getLineWidth() const;
- void setLineWidth(PropertyValue<float>);
+ static DataDrivenPropertyValue<float> getDefaultLineWidth();
+ DataDrivenPropertyValue<float> getLineWidth() const;
+ void setLineWidth(DataDrivenPropertyValue<float>);
void setLineWidthTransition(const TransitionOptions&);
TransitionOptions getLineWidthTransition() const;