[core] Don't resolve tokens after evaluating a text-field or icon-image expression (#11509)

This commit is contained in:
John Firebaugh
2018-03-22 16:44:12 -07:00
committed by GitHub
parent 1d29f82c1b
commit 9499a2bda7
6 changed files with 28 additions and 25 deletions

View File

@@ -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;