From: Daniel Juyung Seo Date: Wed, 15 Jan 2014 06:04:26 +0000 (+0900) Subject: test_photocam: Support zoom in and out with more condition checks. X-Git-Tag: v1.9.0-alpha1~201 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=98679f4ff80518e088b80fe66d09263598fcc932;p=platform%2Fupstream%2Felementary.git test_photocam: Support zoom in and out with more condition checks. Now zoom in and out work sanely. --- 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