[core] fix opacity interpolation for composition expressions (#15738)
port https://github.com/mapbox/mapbox-gl-js/pull/8818
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user