diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-03-29 12:55:29 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-03-30 15:36:30 -0700 |
commit | f4d9fb816d4a22bcc17a07452a926f4f06e75d3b (patch) | |
tree | e4b08eb47a1425b01d18c9e0676a1c6b982940b1 /src | |
parent | cf5d2ca4efc6e00798f03aebaa1c6902f0330230 (diff) | |
download | qtlocation-mapboxgl-f4d9fb816d4a22bcc17a07452a926f4f06e75d3b.tar.gz |
[core] Round-trip linear interpolators
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/style/expression/interpolate.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mbgl/style/expression/interpolate.cpp b/src/mbgl/style/expression/interpolate.cpp index 30b2cba81b..daad8523f2 100644 --- a/src/mbgl/style/expression/interpolate.cpp +++ b/src/mbgl/style/expression/interpolate.cpp @@ -223,7 +223,11 @@ mbgl::Value Interpolate<T>::serialize() const { interpolator.match( [&](const ExponentialInterpolator& exponential) { - serialized.emplace_back(std::vector<mbgl::Value>{{ std::string("exponential"), exponential.base }}); + if (exponential.base == 1) { + serialized.emplace_back(std::vector<mbgl::Value>{{ std::string("linear") }}); + } else { + serialized.emplace_back(std::vector<mbgl::Value>{{ std::string("exponential"), exponential.base }}); + } }, [&](const CubicBezierInterpolator& cubicBezier) { static const std::string cubicBezierTag("cubic-bezier"); |