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

[core] fix opacity interpolation for composition expressions #15738

Merged
merged 3 commits into from
Oct 2, 2019

Conversation

ansis
Copy link
Contributor

@ansis ansis commented Oct 1, 2019

port mapbox/mapbox-gl-js#8818

Previously the interpolation factor could be out of the range 0 to 1 which could result in rendering errors.

I've skipped the render test because -native doesn't have a way to stop sources from loading new tiles. I started trying to add this but bailed because it doesn't seem like it's worth the effort. I opened #15737 to document this.

@ansis ansis requested a review from tmpsantos October 1, 2019 19:56
Copy link
Contributor

@tmpsantos tmpsantos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with squash + merge

@tmpsantos tmpsantos added the Core The cross-platform C++ core, aka mbgl label Oct 2, 2019
const float possiblyRoundedZoom = expression.useIntegerZoom ? std::floor(currentZoom) : currentZoom;

return std::tuple<float>{
::fmax(0.0, ::fmin(1.0, expression.interpolationFactor(zoomRange, possiblyRoundedZoom)))};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sad that std::clamp is C++17 :-/

@ansis ansis merged commit dfca8fb into master Oct 2, 2019
@ansis ansis deleted the port-gl-js-fix-8817 branch October 2, 2019 17:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core The cross-platform C++ core, aka mbgl
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants