lottie/expressions: rectified fill color support

Assign the fill color value properly.
This commit is contained in:
Hermet Park 2024-08-07 19:10:07 +09:00 committed by Hermet Park
parent de9da0b93a
commit 69dccc326a
2 changed files with 20 additions and 12 deletions

View file

@ -349,7 +349,7 @@ static void _updateSolidFill(TVG_UNUSED LottieGroup* parent, LottieObject** chil
auto fill = static_cast<LottieSolidFill*>(*child);
ctx->merging = nullptr;
auto color = fill->color(frameNo);
auto color = fill->color(frameNo, exps);
ctx->propagator->fill(color.rgb[0], color.rgb[1], color.rgb[2], fill->opacity(frameNo, exps));
ctx->propagator->fill(fill->rule);

View file

@ -59,7 +59,6 @@ public:
auto bm_rt = evaluate(frameNo, exp);
if (jerry_value_is_undefined(bm_rt)) return false;
if (jerry_value_is_object(bm_rt)) {
if (auto prop = static_cast<Property*>(jerry_object_get_native_ptr(bm_rt, nullptr))) {
out = (*prop)(frameNo);
} else {
@ -70,7 +69,6 @@ public:
jerry_value_free(x);
jerry_value_free(y);
}
}
jerry_value_free(bm_rt);
return true;
}
@ -83,6 +81,16 @@ public:
if (auto color = static_cast<Property*>(jerry_object_get_native_ptr(bm_rt, nullptr))) {
out = (*color)(frameNo);
} else {
auto r = jerry_object_get_index(bm_rt, 0);
auto g = jerry_object_get_index(bm_rt, 1);
auto b = jerry_object_get_index(bm_rt, 2);
out.rgb[0] = REMAP255(jerry_value_as_number(r));
out.rgb[1] = REMAP255(jerry_value_as_number(g));
out.rgb[2] = REMAP255(jerry_value_as_number(b));
jerry_value_free(r);
jerry_value_free(g);
jerry_value_free(b);
}
jerry_value_free(bm_rt);
return true;