seoz pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=00f667562bbca6b332cc3d6d140df5588c7fefc2

commit 00f667562bbca6b332cc3d6d140df5588c7fefc2
Author: Daniel Juyung Seo <[email protected]>
Date:   Wed Oct 30 08:49:09 2013 +0900

    test_image.c: enhance image click example to look better.
    
    - Keep the final state.
    - Rotate according to the final state.
---
 src/bin/test_image.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/bin/test_image.c b/src/bin/test_image.c
index 3119462..37875ab 100755
--- a/src/bin/test_image.c
+++ b/src/bin/test_image.c
@@ -137,13 +137,24 @@ static void
 _img_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
 {
    Elm_Transit *trans;
+   static int degree = 0;
 
    fprintf(stderr, "%p - clicked\n", obj);
 
    trans = elm_transit_add();
    elm_transit_object_add(trans, data);
-   elm_transit_effect_rotation_add(trans, 0, 180);
-   elm_transit_duration_set(trans, 5.0);
+   if (degree == 0)
+     {
+        elm_transit_effect_rotation_add(trans, 0, 180);
+        degree = 180;
+     }
+   else
+     {
+        elm_transit_effect_rotation_add(trans, 180, 360);
+        degree = 0;
+     }
+   elm_transit_duration_set(trans, 3.0);
+   elm_transit_objects_final_state_keep_set(trans, EINA_TRUE);
    elm_transit_go(trans);
 }
 

-- 


Reply via email to