summaryrefslogtreecommitdiff
path: root/src/static_libs/vg_common/vg_common_json.c
diff options
context:
space:
mode:
authorJunsuChoi <jsuya.choi@samsung.com>2020-01-29 21:40:28 +0900
committerJunsuChoi <jsuya.choi@samsung.com>2020-01-29 21:42:43 +0900
commit9cb73aea1bc46da65579482d4550a7e2e3ad3f13 (patch)
tree67440bae1db9ee1097c7b111e50aa32f64158687 /src/static_libs/vg_common/vg_common_json.c
parent5a3f3d0ab6890de7261dada7d151a9a71a885aa6 (diff)
vg_common_json: Supports transform properties
Summary: Supports scale, position, and rotation properties related to transform among properties supported by value provider. Test Plan: Remove 'json' in evas-loaders-disabler build elementary_test -to "value provider" (path : layer.box1) Depends on D11213 Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11129
Diffstat (limited to '')
-rw-r--r--src/static_libs/vg_common/vg_common_json.c40
1 files changed, 38 insertions, 2 deletions
diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c
index f0e90b5542..a8f46832b8 100644
--- a/src/static_libs/vg_common/vg_common_json.c
+++ b/src/static_libs/vg_common/vg_common_json.c
@@ -531,8 +531,44 @@ _value_provider_override(Vg_File_Data *vfd)
531 } 531 }
532 if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_TRANSFORM_MATRIX) 532 if (flag & EFL_GFX_VG_VALUE_PROVIDER_CHANGE_FLAG_TRANSFORM_MATRIX)
533 { 533 {
534 //TODO: When the lottie animation's transform property is implemented, 534 Eina_Matrix4 m, *orig_m;
535 // the transform property override function have to added. 535 double tx, ty, sx, sy, radian_z, si, cs;
536
537 orig_m = efl_gfx_vg_value_provider_transform_get(vp);
538 if (!orig_m) continue;
539
540 /*
541 * NOTE: We need to impelements 3-axis transform.
542 * now lottie animation provide z projection transform.
543 * In this cace, we calcuate to T * R * S order.
544 */
545 eina_matrix4_copy(&m, orig_m);
546 keypath = efl_gfx_vg_value_provider_keypath_get(vp);
547
548 // Calc Translate
549 eina_matrix4_values_get(&m, NULL, NULL, NULL, &tx,
550 NULL, NULL, NULL, &ty,
551 NULL, NULL, NULL, NULL,
552 NULL, NULL, NULL, NULL);
553 eina_matrix4_translate(&m, -1 * tx, -1 * ty, 0);
554
555 // Calc Rotate
556 eina_matrix4_values_get(&m, &cs, NULL, NULL, NULL,
557 &si, NULL, NULL, NULL,
558 NULL, NULL, NULL, NULL,
559 NULL, NULL, NULL, NULL);
560 radian_z = atan2(si, cs);
561 eina_matrix4_rotate(&m, -1 * radian_z, EINA_MATRIX_AXIS_Z);
562
563 // Calc Scale
564 eina_matrix4_values_get(&m, &sx, NULL, NULL, NULL,
565 NULL, &sy, NULL, NULL,
566 NULL, NULL, NULL, NULL,
567 NULL, NULL, NULL, NULL);
568
569 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_TR_SCALE, (char*)keypath, 100.0 * sx, 100.0 * sy);
570 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_TR_ROTATION, (char*)keypath, radian_z * (180.0 / M_PI));
571 lottie_animation_property_override(lot_anim, LOTTIE_ANIMATION_PROPERTY_TR_POSITION, (char*)keypath, tx, ty);
536 } 572 }
537 } 573 }
538} 574}