Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] fix opacity interpolation for composition expressions (#15738)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansis authored Oct 2, 2019
1 parent 90b3792 commit dfca8fb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 1 addition & 0 deletions platform/node/test/ignores.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
9 changes: 4 additions & 5 deletions src/mbgl/renderer/paint_property_binder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,10 @@ class CompositeFunctionPaintPropertyBinder final : public PaintPropertyBinder<T,
}

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 {
Expand Down

0 comments on commit dfca8fb

Please sign in to comment.