summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-06-16 10:16:11 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-06-16 12:46:12 -0700
commite361bcf66823daa9ae6cae571193a5ba9613c3de (patch)
treed60071749713126967f9d2f69764bc1f040c746d /src
parente1b0f94be0228d41e881aa52ff9529e815e5d59b (diff)
downloadqtlocation-mapboxgl-e361bcf66823daa9ae6cae571193a5ba9613c3de.tar.gz
[core] Fix composite function approximation for non-integer stops
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/renderer/paint_property_binder.hpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mbgl/renderer/paint_property_binder.hpp b/src/mbgl/renderer/paint_property_binder.hpp
index c22291767a..8ac6ce8cf1 100644
--- a/src/mbgl/renderer/paint_property_binder.hpp
+++ b/src/mbgl/renderer/paint_property_binder.hpp
@@ -189,11 +189,11 @@ public:
CompositeFunctionPaintPropertyBinder(style::CompositeFunction<T> function_, float zoom, T defaultValue_)
: function(std::move(function_)),
defaultValue(std::move(defaultValue_)),
- coveringRanges(function.coveringRanges(zoom)) {
+ rangeOfCoveringRanges(function.rangeOfCoveringRanges({zoom, zoom + 1})) {
}
void populateVertexVector(const GeometryTileFeature& feature, std::size_t length) override {
- Range<T> range = function.evaluate(std::get<1>(coveringRanges), feature, defaultValue);
+ Range<T> range = function.evaluate(rangeOfCoveringRanges, feature, defaultValue);
this->statistics.add(range.min);
this->statistics.add(range.max);
AttributeValue value = zoomInterpolatedAttributeValue(
@@ -217,7 +217,7 @@ public:
}
float interpolationFactor(float currentZoom) const override {
- return util::interpolationFactor(1.0f, std::get<0>(coveringRanges), currentZoom);
+ return util::interpolationFactor(1.0f, { rangeOfCoveringRanges.min.zoom, rangeOfCoveringRanges.max.zoom }, currentZoom);
}
T uniformValue(const PossiblyEvaluatedPropertyValue<T>& currentValue) const override {
@@ -230,10 +230,10 @@ public:
}
private:
- using InnerStops = typename style::CompositeFunction<T>::InnerStops;
style::CompositeFunction<T> function;
T defaultValue;
- std::tuple<Range<float>, Range<InnerStops>> coveringRanges;
+ using CoveringRanges = typename style::CompositeFunction<T>::CoveringRanges;
+ Range<CoveringRanges> rangeOfCoveringRanges;
gl::VertexVector<Vertex> vertexVector;
optional<gl::VertexBuffer<Vertex>> vertexBuffer;
};