diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-03-22 16:44:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 16:44:12 -0700 |
commit | 9499a2bda7eed68f8a11cdecce0130b1be2054a4 (patch) | |
tree | bf26cc0af726388039a1d6de12cc3a091a2ec175 /include/mbgl/style/function/composite_function.hpp | |
parent | 1d29f82c1b636166053874323ee04ade5b243275 (diff) | |
download | qtlocation-mapboxgl-9499a2bda7eed68f8a11cdecce0130b1be2054a4.tar.gz |
[core] Don't resolve tokens after evaluating a text-field or icon-image expression (#11509)
Diffstat (limited to 'include/mbgl/style/function/composite_function.hpp')
-rw-r--r-- | include/mbgl/style/function/composite_function.hpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/include/mbgl/style/function/composite_function.hpp b/include/mbgl/style/function/composite_function.hpp index f391b101ae..614c345c25 100644 --- a/include/mbgl/style/function/composite_function.hpp +++ b/include/mbgl/style/function/composite_function.hpp @@ -51,16 +51,16 @@ public: CompositeCategoricalStops<T>>>; CompositeFunction(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)); } - CompositeFunction(std::string property_, Stops stops_, optional<T> defaultValue_ = {}) - : property(std::move(property_)), - stops(std::move(stops_)), + CompositeFunction(const std::string& property, const Stops& stops, optional<T> defaultValue_ = {}) + : isExpression(false), defaultValue(std::move(defaultValue_)), expression(stops.match([&] (const auto& s) { return expression::Convert::toExpression(property, s); @@ -113,12 +113,11 @@ public: const expression::Expression& getExpression() const { return *expression; } - std::string property; - Stops stops; - optional<T> defaultValue; bool useIntegerZoom = false; + bool isExpression; private: + optional<T> defaultValue; std::shared_ptr<expression::Expression> expression; const variant<const expression::InterpolateBase*, const expression::Step*> zoomCurve; }; |