[core] fix opacity interpolation for composition expressions (#15738)

port https://github.com/mapbox/mapbox-gl-js/pull/8818
This commit is contained in:
Ansis Brammanis
2019-10-02 13:49:33 -04:00
committed by GitHub
parent 90b37927eb
commit dfca8fb214
2 changed files with 5 additions and 5 deletions

View File

@@ -71,6 +71,7 @@
"render-tests/circle-sort-key/literal": "https://github.com/mapbox/mapbox-gl-native/issues/15008",
"render-tests/fill-sort-key/literal": "https://github.com/mapbox/mapbox-gl-native/issues/15008",
"render-tests/line-sort-key/literal": "https://github.com/mapbox/mapbox-gl-native/issues/15008",
"render-tests/regressions/mapbox-gl-js#8817": "skip - https://github.com/mapbox/mapbox-gl-native/issues/15737",
"query-tests/fill-extrusion/base-in": "https://github.com/mapbox/mapbox-gl-native/issues/13139",
"query-tests/fill-extrusion/box-in": "https://github.com/mapbox/mapbox-gl-native/issues/13139",
"query-tests/fill-extrusion/side-in": "https://github.com/mapbox/mapbox-gl-native/issues/13139",

View File

@@ -370,11 +370,10 @@ public:
}
std::tuple<float> interpolationFactor(float currentZoom) const override {
if (expression.useIntegerZoom) {
return std::tuple<float> { expression.interpolationFactor(zoomRange, std::floor(currentZoom)) };
} else {
return std::tuple<float> { expression.interpolationFactor(zoomRange, currentZoom) };
}
const float possiblyRoundedZoom = expression.useIntegerZoom ? std::floor(currentZoom) : currentZoom;
return std::tuple<float>{
::fmax(0.0, ::fmin(1.0, expression.interpolationFactor(zoomRange, possiblyRoundedZoom)))};
}
std::tuple<T> uniformValue(const PossiblyEvaluatedPropertyValue<T>& currentValue) const override {