seoz pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=98679f4ff80518e088b80fe66d09263598fcc932

commit 98679f4ff80518e088b80fe66d09263598fcc932
Author: Daniel Juyung Seo <seojuyu...@gmail.com>
Date:   Wed Jan 15 15:04:26 2014 +0900

    test_photocam: Support zoom in and out with more condition checks.
    
    Now zoom in and out work sanely.
---
 src/bin/test_photocam.c | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/bin/test_photocam.c b/src/bin/test_photocam.c
index a715249..dbab32d 100644
--- a/src/bin/test_photocam.c
+++ b/src/bin/test_photocam.c
@@ -132,9 +132,21 @@ my_bt_zoom_in(void *data, Evas_Object *obj EINA_UNUSED, 
void *event_info EINA_UN
    double zoom;
 
    zoom = elm_photocam_zoom_get(data);
-   zoom -= 0.5;
+   if (zoom > 1.5)
+     zoom -= 0.5;
+   else if ((zoom > 1.0) && (zoom <= 1.5))
+     zoom = 1.0;
+   else if (zoom == 1.0)
+     zoom = 0.8;
+   else
+     zoom = zoom * zoom;
+
    elm_photocam_zoom_mode_set(data, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
-   if (zoom >= (1.0 / 32.0)) elm_photocam_zoom_set(data, zoom);
+   if (zoom >= (1.0 / 32.0))
+     {
+        printf("zoom %f\n", zoom);
+        elm_photocam_zoom_set(data, zoom);
+     }
 }
 
 static void
@@ -145,7 +157,11 @@ my_bt_zoom_out(void *data, Evas_Object *obj EINA_UNUSED, 
void *event_info EINA_U
    zoom = elm_photocam_zoom_get(data);
    zoom += 0.5;
    elm_photocam_zoom_mode_set(data, ELM_PHOTOCAM_ZOOM_MODE_MANUAL);
-   if (zoom <= 256.0) elm_photocam_zoom_set(data, zoom);
+   if (zoom <= 256.0)
+     {
+        printf("zoom %f\n", zoom);
+        elm_photocam_zoom_set(data, zoom);
+     }
 }
 
 static void

-- 


Reply via email to