From 179bf55bd63405a3317414f7959c59937a7caca2 Mon Sep 17 00:00:00 2001 From: Jisung Ahn Date: Wed, 23 Jan 2013 18:31:23 +0900 Subject: [PATCH] fix caller id rotate region error Change-Id: I1cec38d7b588a58c4e79ae62c4a26c9e4eab797d --- main/src/view/ivug-crop-view.cpp | 1 + main/src/view/ivug-setas-view-callerid.cpp | 60 +++++++++++++++++++----------- widget/src/scissorbox/ScissorBox.cpp | 2 +- 3 files changed, 41 insertions(+), 22 deletions(-) mode change 100644 => 100755 widget/src/scissorbox/ScissorBox.cpp diff --git a/main/src/view/ivug-crop-view.cpp b/main/src/view/ivug-crop-view.cpp index 6d4b242..979e500 100755 --- a/main/src/view/ivug-crop-view.cpp +++ b/main/src/view/ivug-crop-view.cpp @@ -46,6 +46,7 @@ static void _on_layout_resized(void *data, Evas *e, Evas_Object *obj, void *even MSG_HIGH("rotate=%d", rotate); if(pCropView->PrevRotate == rotate) { + MSG_ERROR("smame rotate!, return"); return; } pCropView->PrevRotate = rotate; diff --git a/main/src/view/ivug-setas-view-callerid.cpp b/main/src/view/ivug-setas-view-callerid.cpp index 8216adf..a67f105 100755 --- a/main/src/view/ivug-setas-view-callerid.cpp +++ b/main/src/view/ivug-setas-view-callerid.cpp @@ -96,6 +96,14 @@ static void _put_scissorbox_default(TSetAsData *pSetAsData) ivug_image_image_size_get(pSetAsData->photocam, &image_w, &image_h); // Get original image size. + /*int degree = ivug_image_rotate_get(pSetAsData->photocam); + if(degree == 90 || degree == 270) //rotated + { + int temp = image_w; + image_w = image_h; + image_h = temp; + }*/ + int px, py, pw, ph; ivug_image_region_get(pSetAsData->photocam, &px, &py, &pw, &ph); @@ -146,6 +154,18 @@ static void _put_scissorbox_default(TSetAsData *pSetAsData) ivug_scissorbox_region_set(pSetAsData->crop.box, rect.x, rect.y, rect.w, rect.h); ivug_scissorbox_attach(pSetAsData->crop.box, image); // Attach to photocam + + int lcd_x, lcd_y, lcd_w, lcd_h; + + evas_object_geometry_get(pSetAsData->contents_area, &lcd_x, &lcd_y, &lcd_w, &lcd_h); + MSG_SETAS_MED("lcd_x=%d, lcd_y=%d, lcd_w=%d, lcd_h=%d", lcd_x, lcd_y, lcd_w, lcd_h); + + ivug_scissorbox_boundary_set(pSetAsData->crop.box, px, lcd_y+py, pw, ph); + + pSetAsData->prev_x = px; //lcd_x is wrong because transition effect + pSetAsData->prev_y = lcd_y+py; + pSetAsData->prev_w = pw; + pSetAsData->prev_h = ph; } static Eina_Bool _put_scissorbox_timer_cb(void *data) @@ -233,14 +253,6 @@ _on_photocam_loaded(void *data, Evas_Object *obj, void *event_info) "setasview.contents.swallow.notify")); pSetAsData->notify = ivug_notify_static_create(pSetAsData->notify_area, IDS_CALLER_ID_NOTIFY, NOTIFY_ALIGN_BOTTOM); - - int x, y, w, h; - ivug_image_region_get(pSetAsData->photocam, &x, &y, &w, &h); - - pSetAsData->prev_x = x; - pSetAsData->prev_y = y; - pSetAsData->prev_w = w; - pSetAsData->prev_h = h; } @@ -276,7 +288,7 @@ static void _on_resized(void *data, Evas *e, Evas_Object *obj, void *event_info) int lcd_x, lcd_y, lcd_w, lcd_h; - evas_object_geometry_get(obj, &lcd_x, &lcd_y, &lcd_w, &lcd_h); + evas_object_geometry_get(pSetAsData->contents_area, &lcd_x, &lcd_y, &lcd_w, &lcd_h); MSG_SETAS_MED("lcd_x=%d, lcd_y=%d, lcd_w=%d, lcd_h=%d", lcd_x, lcd_y, lcd_w, lcd_h); int ph, pw; @@ -319,10 +331,18 @@ static void _on_resized(void *data, Evas *e, Evas_Object *obj, void *event_info) dx *= zoom; dy *= zoom; - sx = (ext_w-img_w*zoom)/2 + dx; - sy = (ext_h-img_h*zoom)/2 + dy; + sx = lcd_x + (ext_w-img_w*zoom)/2 + dx; + sy = lcd_y + (ext_h-img_h*zoom)/2 + dy; + + + int bound_x, bound_y, bound_w, bound_h; - ivug_scissorbox_boundary_set(pSetAsData->crop.box, (ext_w-img_w*zoom)/2, (ext_h-img_h*zoom)/2, img_w*zoom, img_h*zoom); + bound_x = lcd_x+(ext_w-img_w*zoom)/2; + bound_y = lcd_y+(ext_h-img_h*zoom)/2; + bound_w = img_w*zoom; + bound_h = img_h*zoom; + + ivug_scissorbox_boundary_set(pSetAsData->crop.box, bound_x, bound_y, bound_w, bound_h); /////////////////////////////////////////////////////////////////// @@ -330,14 +350,12 @@ static void _on_resized(void *data, Evas *e, Evas_Object *obj, void *event_info) ivug_scissorbox_region_set(pSetAsData->crop.box, sx, sy, sw, sh); - ivug_image_region_get(pSetAsData->photocam, &org_x, &org_y, &org_w, &org_h); - - MSG_SETAS_MED("org_x=%d, org_y=%d, org_w=%d, org_h=%d", org_x, org_y, org_w, org_h); + pSetAsData->prev_x = bound_x; + pSetAsData->prev_y = bound_y; + pSetAsData->prev_w = bound_w; + pSetAsData->prev_h = bound_h; - pSetAsData->prev_x = org_x; - pSetAsData->prev_y = org_y; - pSetAsData->prev_w = org_w; - pSetAsData->prev_h = org_h; + MSG_SETAS_MED("prev_x=%d, prev_y=%d, prev_w=%d, prev_h=%d", pSetAsData->prev_x, pSetAsData->prev_y, pSetAsData->prev_w, pSetAsData->prev_h); } static Evas_Event_Flags _finger_tap_end(void *data , void *event_info) @@ -355,7 +373,7 @@ static Evas_Event_Flags _finger_tap_end(void *data , void *event_info) { MSG_SETAS_HIGH("Hide"); elm_win_indicator_mode_set((Evas_Object*)ug_get_window(), ELM_WIN_INDICATOR_HIDE); - evas_object_hide(pSetAsData->notify); + //evas_object_hide(pSetAsData->notify); } else { @@ -364,7 +382,7 @@ static Evas_Event_Flags _finger_tap_end(void *data , void *event_info) { elm_win_indicator_mode_set((Evas_Object *)ug_get_window(), ELM_WIN_INDICATOR_SHOW); } - evas_object_show(pSetAsData->notify); + //evas_object_show(pSetAsData->notify); } pSetAsData->bShowMenu = !pSetAsData->bShowMenu; diff --git a/widget/src/scissorbox/ScissorBox.cpp b/widget/src/scissorbox/ScissorBox.cpp old mode 100644 new mode 100755 index 3569e8e..a4077de --- a/widget/src/scissorbox/ScissorBox.cpp +++ b/widget/src/scissorbox/ScissorBox.cpp @@ -229,7 +229,7 @@ public: dx = cx - px; dy = cy - py; - MSG_HIGH("Mouse move XY(%d,%d) -> XY(%d,%d)", px, py, cx, cy); + MSG_MED("Mouse move XY(%d,%d) -> XY(%d,%d)", px, py, cx, cy); if ( dx == 0 && dy == 0) { return; -- 2.7.4