summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShilpa Singh <shilpa.singh@samsung.com>2015-10-21 14:39:05 -0700
committerNicolas Aguirre <aguirre.nicolas@gmail.com>2015-11-12 10:15:03 +0100
commit40b6c9c3073dbef9574021b9ce95c386911c5c52 (patch)
treed1a00ca77bba265e373c7e3eeb42262c673d8e1b
parent8326a4a25f39f7a9be95ff7a9030e31c6fe63dd5 (diff)
elm_cnp: DnD/X11: correct drag window position in rotation
Summary: For various angles 90, 180, 270, the calculation of dnd window position is not proper causing window to be placed wrongly while dragging. Signed-Off By: Kumar Navneet <k.navneet@samsung.com> @fix Test Plan: Longpress and drag and drop in entry by placing device at various angles 90, 180 and 270. Reviewers: woohyun, cedric, thiepha Reviewed By: thiepha Subscribers: navnbeet Differential Revision: https://phab.enlightenment.org/D3188 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_cnp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index 00d5aa52d..2f7ab7d28 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -2233,8 +2233,6 @@ _x11_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
2233 evas_object_show(icon); 2233 evas_object_show(icon);
2234 evas_object_show(dragwin); 2234 evas_object_show(dragwin);
2235 evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x3, &y3); 2235 evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x3, &y3);
2236 _dragx = x3 - x2;
2237 _dragy = y3 - y2;
2238 2236
2239 rot = ecore_evas_rotation_get(ee); 2237 rot = ecore_evas_rotation_get(ee);
2240 switch (rot) 2238 switch (rot)
@@ -2242,18 +2240,26 @@ _x11_elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, const char *data,
2242 case 90: 2240 case 90:
2243 xr = y3; 2241 xr = y3;
2244 yr = ew - x3; 2242 yr = ew - x3;
2243 _dragx = y3 - y2;
2244 _dragy = x3 - x2;
2245 break; 2245 break;
2246 case 180: 2246 case 180:
2247 xr = ew - x3; 2247 xr = ew - x3;
2248 yr = eh - y3; 2248 yr = eh - y3;
2249 _dragx = x3 - x2;
2250 _dragy = y3 - y2;
2249 break; 2251 break;
2250 case 270: 2252 case 270:
2251 xr = eh - y3; 2253 xr = eh - y3;
2252 yr = x3; 2254 yr = x3;
2255 _dragx = y3 - y2;
2256 _dragy = x3 - x2;
2253 break; 2257 break;
2254 default: 2258 default:
2255 xr = x3; 2259 xr = x3;
2256 yr = y3; 2260 yr = y3;
2261 _dragx = x3 - x2;
2262 _dragy = y3 - y2;
2257 break; 2263 break;
2258 } 2264 }
2259 x = ex + xr - _dragx; 2265 x = ex + xr - _dragx;