mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-09 22:23:27 +00:00
lottie/expressions: ++coverage
Allow direct key[0]/key[1] access for key.value in expression issue: https://github.com/thorvg/thorvg/issues/2722
This commit is contained in:
parent
5fc52ea6b0
commit
ae6faf56c5
2 changed files with 9 additions and 1 deletions
File diff suppressed because one or more lines are too long
|
@ -935,6 +935,14 @@ static jerry_value_t _key(const jerry_call_info_t* info, const jerry_value_t arg
|
||||||
jerry_object_set_sz(obj, EXP_INDEX, args[0]);
|
jerry_object_set_sz(obj, EXP_INDEX, args[0]);
|
||||||
jerry_object_set_sz(obj, EXP_VALUE, value);
|
jerry_object_set_sz(obj, EXP_VALUE, value);
|
||||||
|
|
||||||
|
//direct access, key[0], key[1]
|
||||||
|
if (exp->property->type == LottieProperty::Type::Float) {
|
||||||
|
jerry_object_set_index(obj, 0, value);
|
||||||
|
} else if (exp->property->type == LottieProperty::Type::Point || exp->property->type == LottieProperty::Type::Position) {
|
||||||
|
jerry_object_set_index(obj, 0, jerry_object_get_index(value, 0));
|
||||||
|
jerry_object_set_index(obj, 1, jerry_object_get_index(value, 1));
|
||||||
|
}
|
||||||
|
|
||||||
jerry_value_free(time);
|
jerry_value_free(time);
|
||||||
jerry_value_free(value);
|
jerry_value_free(value);
|
||||||
|
|
||||||
|
@ -942,7 +950,6 @@ static jerry_value_t _key(const jerry_call_info_t* info, const jerry_value_t arg
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static jerry_value_t _createPath(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt)
|
static jerry_value_t _createPath(const jerry_call_info_t* info, const jerry_value_t args[], const jerry_length_t argsCnt)
|
||||||
{
|
{
|
||||||
//TODO: arg1: points, arg2: inTangents, arg3: outTangents, arg4: isClosed
|
//TODO: arg1: points, arg2: inTangents, arg3: outTangents, arg4: isClosed
|
||||||
|
|
Loading…
Add table
Reference in a new issue