diff options
author | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2017-04-27 22:31:47 +0900 |
---|---|---|
committer | Jaehyun Cho <jae_hyun.cho@samsung.com> | 2017-05-25 21:23:35 +0900 |
commit | 0be4a95b15e19943f0a7a43cdf98ac55152cc40b (patch) | |
tree | c00feac472dd0d81320d4151cf78002a13f12c9a | |
parent | 0a6b21489c5a017eb2c2dba8de214dde8a06670d (diff) | |
download | efl-0be4a95b15e19943f0a7a43cdf98ac55152cc40b.tar.gz |
efl_animation: Implement alpha animation
This is temporary test code.
-rw-r--r-- | src/lib/evas/canvas/efl_animation_alpha.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/efl_animation_alpha.c b/src/lib/evas/canvas/efl_animation_alpha.c index a490c35648..f6c8914322 100644 --- a/src/lib/evas/canvas/efl_animation_alpha.c +++ b/src/lib/evas/canvas/efl_animation_alpha.c @@ -18,6 +18,9 @@ } \ } while (0) +#define EFL_ANIMATION_ALPHA_DATA_GET(o, pd) \ + Evas_Object_Animation_Alpha_Data *pd = efl_data_scope_get(o, EFL_ANIMATION_ALPHA_CLASS) + typedef struct _Evas_Object_Animation_Alpha_Property { double alpha; @@ -50,9 +53,20 @@ _efl_animation_alpha_alpha_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Animation_Alp } static void -_animate_cb(void *data, const Efl_Event *event) +_animate_cb(void *data EINA_UNUSED, const Efl_Event *event) { + EFL_ANIMATION_ALPHA_DATA_GET(event->object, pd); Efl_Animation_Animate_Event_Info *event_info = event->info; + + double progress = event_info->progress; + + double alpha + = (pd->from.alpha * (1.0 - progress)) + (pd->to.alpha * progress); + + //FIXME: The below code is temporary test code + int color = (int)(alpha * 255); + Evas_Object *target = efl_animation_target_get(event->object); + evas_object_color_set(target, color, color, color, color); } EOLIAN static Efl_Object * |