Fixed drag position issue
authorbunam.jeon <bunam.jeon@samsung.com>
Thu, 12 Sep 2013 23:51:40 +0000 (08:51 +0900)
committerbunam.jeon <bunam.jeon@samsung.com>
Thu, 12 Sep 2013 23:51:40 +0000 (08:51 +0900)
[Title]    Fixed drag position issue
[Issue#]   N_SE-52018, N_SE-52010
[Problem]  Drag image position is wrong when tab the drag image
[Cause]    Unnecessary offset was applied
[Solution] Modify position when tab the drag image

Change-Id: Ib9d241bec5970ae19c34b024e6567586c2a96c2f

Source/WebKit2/UIProcess/API/efl/tizen/Drag.cpp
Source/WebKit2/UIProcess/API/efl/tizen/Drag.h
Source/WebKit2/UIProcess/API/efl/tizen/DragHandle.cpp

index 3c24476..c649c9f 100755 (executable)
@@ -97,6 +97,11 @@ void Drag::Show()
 }
 
 // handle callbacks
+void Drag::handleMouseDown(DragHandle* handle)
+{
+    m_Handle->move(handle->position());
+}
+
 void Drag::handleMouseMove(DragHandle* handle)
 {
     IntPoint viewPoint = m_viewImpl->transformFromScene().mapPoint(handle->position());
index 5fa38db..ede5390 100755 (executable)
@@ -58,6 +58,7 @@ public:
     EwkViewImpl* getViewImpl() { return m_viewImpl; }
 
     // handle callback
+    void handleMouseDown(DragHandle* handle);
     void handleMouseMove(DragHandle* handle);
     void handleMouseUp(DragHandle* handle);
 
index 90f4eef..bbf4a18 100755 (executable)
@@ -34,7 +34,6 @@ using namespace WebCore;
 
 namespace WebKit {
 
-const int s_iconOffset = 90;
 const int s_widthMargin = 20;
 const int s_heightMargin = 10;
 const int s_cancelImageXMargin = 26;
@@ -44,7 +43,6 @@ const double s_minIconHeight = 100;
 const double s_minImageLength = 90;
 const double s_maxImageLength = 300;
 
-
 DragHandle::DragHandle(Evas_Object* object, const String& theme, const String& path, Drag* drag)
     : m_view(object)
     , m_drag(drag)
@@ -219,7 +217,8 @@ void DragHandle::mouseDown(void* data, Evas*, Evas_Object*, void* eventInfo)
     Evas_Event_Mouse_Down* event = static_cast<Evas_Event_Mouse_Down*>(eventInfo);
     DragHandle* handle = static_cast<DragHandle*>(data);
 
-    handle->setMousePosition(IntPoint(event->canvas.x, event->canvas.y - s_iconOffset));
+    handle->setMousePosition(IntPoint(event->canvas.x, event->canvas.y));
+    handle->m_drag->handleMouseDown(handle);
 }
 
 void DragHandle::mouseMove(void* data, Evas*, Evas_Object*, void* eventInfo)
@@ -227,7 +226,7 @@ void DragHandle::mouseMove(void* data, Evas*, Evas_Object*, void* eventInfo)
     Evas_Event_Mouse_Move* event = static_cast<Evas_Event_Mouse_Move*>(eventInfo);
     DragHandle* handle = static_cast<DragHandle*>(data);
 
-    handle->setMousePosition(IntPoint(event->cur.canvas.x, event->cur.canvas.y - s_iconOffset));
+    handle->setMousePosition(IntPoint(event->cur.canvas.x, event->cur.canvas.y));
 
     if (!handle->m_dragJob)
        handle->m_dragJob = ecore_job_add(update, data);