cedric pushed a commit to branch master.

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

commit b3cc2d73951831bfec3f5f7d30640db18ee70e66
Author: Shilpa Singh <shilpa.si...@samsung.com>
Date:   Wed Oct 21 14:39:05 2015 -0700

    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.navn...@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 <ced...@osg.samsung.com>
---
 src/lib/elm_cnp.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index 00d5aa5..2f7ab7d 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,
    evas_object_show(icon);
    evas_object_show(dragwin);
    evas_pointer_canvas_xy_get(evas_object_evas_get(obj), &x3, &y3);
-   _dragx = x3 - x2;
-   _dragy = y3 - y2;
 
    rot = ecore_evas_rotation_get(ee);
    switch (rot)
@@ -2242,18 +2240,26 @@ _x11_elm_drag_start(Evas_Object *obj, Elm_Sel_Format 
format, const char *data,
       case 90:
          xr = y3;
          yr = ew - x3;
+         _dragx = y3 - y2;
+         _dragy = x3 - x2;
          break;
       case 180:
          xr = ew - x3;
          yr = eh - y3;
+         _dragx = x3 - x2;
+         _dragy = y3 - y2;
          break;
       case 270:
          xr = eh - y3;
          yr = x3;
+         _dragx = y3 - y2;
+         _dragy = x3 - x2;
          break;
       default:
          xr = x3;
          yr = y3;
+         _dragx = x3 - x2;
+         _dragy = y3 - y2;
          break;
      }
    x = ex + xr - _dragx;

-- 


Reply via email to