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 852424e69d
commit 8b2024a8f4
2 changed files with 5 additions and 3 deletions

View file

@ -1283,8 +1283,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->idx); auto index = jerry_number(exp->layer->idx);
jerry_object_set_sz(global, EXP_INDEX, index); jerry_object_set_sz(global, EXP_INDEX, index);
jerry_value_free(index); jerry_value_free(index);
@ -1392,7 +1394,7 @@ jerry_value_t LottieExpressions::evaluate(float frameNo, LottieExpression* exp)
{ {
if (exp->disabled) return jerry_undefined(); if (exp->disabled) return jerry_undefined();
buildGlobal(exp); buildGlobal(frameNo, exp);
//main composition //main composition
buildComp(exp->comp, frameNo, exp); buildComp(exp->comp, frameNo, exp);

View file

@ -139,7 +139,7 @@ private:
void buildComp(LottieComposition* comp, float frameNo, LottieExpression* exp); void buildComp(LottieComposition* comp, float frameNo, LottieExpression* exp);
void buildComp(jerry_value_t context, float frameNo, LottieLayer* comp, LottieExpression* exp); void buildComp(jerry_value_t context, float frameNo, LottieLayer* comp, LottieExpression* exp);
void buildGlobal(LottieExpression* exp); void buildGlobal(float frameNo, LottieExpression* exp);
//global object, attributes, methods //global object, attributes, methods
jerry_value_t global; jerry_value_t global;