diff options
Diffstat (limited to 'include/mbgl/style/function/composite_function.hpp')
-rw-r--r-- | include/mbgl/style/function/composite_function.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/mbgl/style/function/composite_function.hpp b/include/mbgl/style/function/composite_function.hpp index f7cbab1b21..7d77d5e552 100644 --- a/include/mbgl/style/function/composite_function.hpp +++ b/include/mbgl/style/function/composite_function.hpp @@ -50,6 +50,18 @@ public: using Interpolator = expression::ExponentialInterpolator<T>; using Curve = expression::Curve<Interpolator>; + CompositeFunction(std::unique_ptr<expression::Expression> expression_) + : expression(std::move(expression_)), + interpolator([&]() -> Interpolator { + optional<Curve*> zoomCurve = findZoomCurve(expression.get()); + assert(zoomCurve); + return (*zoomCurve)->getInterpolator(); + }()) + { + assert(!expression->isZoomConstant()); + assert(!expression->isFeatureConstant()); + } + CompositeFunction(std::string property_, Stops stops_, optional<T> defaultValue_ = {}) : property(std::move(property_)), stops(std::move(stops_)), |