-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Round-trip linear interpolators (release-boba) #11565
Conversation
c9f1400
to
e29f8c1
Compare
This test is failing because mapbox/mapbox-gl-js@34902f8 includes mapbox/mapbox-gl-js#6388, which hasn’t been ported to gl-native yet: [
- "to-rgba",
+ "literal",
[
- "rgba",
+ null,
null,
null,
0,
- 0,
0,
0
]
]f([{},{}])
Expected: [0,0,0,0]
Actual: [null,null,null,0]f([{},{}])
Expected: [0,0,0,0]
Actual: [null,null,null,0]
* failed to-rgba zero The division by zero is easy to address, but the test still fails because the /cc @jfirebaugh |
da95eca6356ec90260d7ac4205a06d04f9959c3d ports mapbox/mapbox-gl-js#6388 and depends on mapbox/mapbox-gl-js#6427, which corrects the relevant test fixture. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. A couple nitpicks inline. Also, since you'll be rebasing/squashing anyway, could we separate the color alpha 0 fix into a commit separate from the serialization fix?
src/mbgl/style/expression/value.cpp
Outdated
@@ -106,12 +106,13 @@ Value ValueConverter<mbgl::Value>::toExpressionValue(const mbgl::Value& value) { | |||
mbgl::Value ValueConverter<mbgl::Value>::fromExpressionValue(const Value& value) { | |||
return value.match( | |||
[&](const Color& color)->mbgl::Value { | |||
auto array = color.toArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/auto/std::array<double, 4>/
src/mbgl/util/color.cpp
Outdated
@@ -23,11 +23,25 @@ optional<Color> Color::parse(const std::string& s) { | |||
} | |||
|
|||
std::string Color::stringify() const { | |||
auto array = toArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/auto/std::array<double, 4>/
src/mbgl/util/color.cpp
Outdated
|
||
std::array<double, 4> Color::toArray() const { | ||
if (a == 0) { | ||
return {{}}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd vote for explicitly listing 0, 0, 0, 0
here
da95eca
to
a88ed20
Compare
Fixed (and squashed into two separate commits). |
a88ed20
to
d066e94
Compare
Backport of #11564 and mapbox/mapbox-gl-js#6388 to the release-boba branch.
Unblocks #11389. Depends on mapbox/mapbox-gl-js#6427.
/cc @ChrisLoer @anandthakker