diff options
Diffstat (limited to 'include/mbgl/style/function/camera_function.hpp')
-rw-r--r-- | include/mbgl/style/function/camera_function.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/mbgl/style/function/camera_function.hpp b/include/mbgl/style/function/camera_function.hpp index 1da5d2c601..97ba633e44 100644 --- a/include/mbgl/style/function/camera_function.hpp +++ b/include/mbgl/style/function/camera_function.hpp @@ -27,15 +27,16 @@ public: IntervalStops<T>>>; CameraFunction(std::unique_ptr<expression::Expression> expression_) - : expression(std::move(expression_)), + : isExpression(true), + expression(std::move(expression_)), zoomCurve(expression::findZoomCurveChecked(expression.get())) { assert(!expression::isZoomConstant(*expression)); assert(expression::isFeatureConstant(*expression)); } - CameraFunction(Stops stops_) - : stops(std::move(stops_)), + CameraFunction(const Stops& stops) + : isExpression(false), expression(stops.match([&] (const auto& s) { return expression::Convert::toExpression(s); })), @@ -76,12 +77,10 @@ public: } bool useIntegerZoom = false; + bool isExpression; const expression::Expression& getExpression() const { return *expression; } - // retained for compatibility with pre-expression function API - Stops stops; - private: std::shared_ptr<expression::Expression> expression; const variant<const expression::InterpolateBase*, const expression::Step*> zoomCurve; |