support constants within dasharrays
This commit is contained in:
@@ -209,7 +209,7 @@ Color parseColor(JSVal value) {
|
||||
css_color.a}};
|
||||
}
|
||||
|
||||
std::tuple<bool,std::vector<float>> parseFloatArray(JSVal value) {
|
||||
std::tuple<bool,std::vector<float>> StyleParser::parseFloatArray(JSVal value) {
|
||||
if (!value.IsArray()) {
|
||||
Log::Warning(Event::ParseStyle, "dasharray value must be an array of numbers");
|
||||
return std::tuple<bool, std::vector<float>> { false, std::vector<float>() };
|
||||
@@ -217,7 +217,7 @@ std::tuple<bool,std::vector<float>> parseFloatArray(JSVal value) {
|
||||
|
||||
std::vector<float> vec;
|
||||
for (rapidjson::SizeType i = 0; i < value.Size(); ++i) {
|
||||
JSVal part = value[i];
|
||||
JSVal part = replaceConstant(value[i]);
|
||||
if (!part.IsNumber()) {
|
||||
Log::Warning(Event::ParseStyle, "dasharray value must be an array of numbers");
|
||||
return std::tuple<bool, std::vector<float>> { false, std::vector<float>() };
|
||||
|
||||
@@ -87,6 +87,8 @@ private:
|
||||
template <typename T>
|
||||
std::tuple<bool, std::vector<std::pair<float, T>>> parseStops(JSVal value, const char *property_name);
|
||||
|
||||
std::tuple<bool,std::vector<float>> parseFloatArray(JSVal value);
|
||||
|
||||
FilterExpression parseFilter(JSVal);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user