lottie/expressions: hotfix

issue: https://github.com/thorvg/thorvg/issues/3400
This commit is contained in:
Hermet Park 2025-04-12 15:22:51 +09:00
parent 934a6e5418
commit d0f33a1bc5
2 changed files with 5 additions and 3 deletions

View file

@ -1266,8 +1266,10 @@ static void _buildMath(jerry_value_t context)
}
void LottieExpressions::buildGlobal(LottieExpression* exp)
void LottieExpressions::buildGlobal(float frameNo, LottieExpression* exp)
{
jerry_object_set_native_ptr(comp, &freeCb, _expcontent(exp, frameNo, exp->layer));
auto index = jerry_number(exp->layer->ix);
jerry_object_set_sz(global, EXP_INDEX, index);
jerry_value_free(index);
@ -1382,7 +1384,7 @@ jerry_value_t LottieExpressions::evaluate(float frameNo, LottieExpression* exp)
{
if (exp->disabled && exp->writables.empty()) return jerry_undefined();
buildGlobal(exp);
buildGlobal(frameNo, exp);
//main composition
buildComp(exp->comp, frameNo, exp);

View file

@ -140,7 +140,7 @@ private:
void buildComp(LottieComposition* comp, float frameNo, LottieExpression* exp);
void buildComp(jerry_value_t context, float frameNo, LottieLayer* comp, LottieExpression* exp);
void buildGlobal(LottieExpression* exp);
void buildGlobal(float frameNo, LottieExpression* exp);
void buildWritables(LottieExpression* exp);
Point toPoint2d(jerry_value_t obj);