From d1875ed71e4e0edf0934d117d80419ed6678e324 Mon Sep 17 00:00:00 2001 From: "bunam.jeon" Date: Fri, 13 Sep 2013 08:51:40 +0900 Subject: [PATCH] Fixed drag position issue [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 | 5 +++++ Source/WebKit2/UIProcess/API/efl/tizen/Drag.h | 1 + Source/WebKit2/UIProcess/API/efl/tizen/DragHandle.cpp | 7 +++---- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/WebKit2/UIProcess/API/efl/tizen/Drag.cpp b/Source/WebKit2/UIProcess/API/efl/tizen/Drag.cpp index 3c24476..c649c9f 100755 --- a/Source/WebKit2/UIProcess/API/efl/tizen/Drag.cpp +++ b/Source/WebKit2/UIProcess/API/efl/tizen/Drag.cpp @@ -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()); diff --git a/Source/WebKit2/UIProcess/API/efl/tizen/Drag.h b/Source/WebKit2/UIProcess/API/efl/tizen/Drag.h index 5fa38db..ede5390 100755 --- a/Source/WebKit2/UIProcess/API/efl/tizen/Drag.h +++ b/Source/WebKit2/UIProcess/API/efl/tizen/Drag.h @@ -58,6 +58,7 @@ public: EwkViewImpl* getViewImpl() { return m_viewImpl; } // handle callback + void handleMouseDown(DragHandle* handle); void handleMouseMove(DragHandle* handle); void handleMouseUp(DragHandle* handle); diff --git a/Source/WebKit2/UIProcess/API/efl/tizen/DragHandle.cpp b/Source/WebKit2/UIProcess/API/efl/tizen/DragHandle.cpp index 90f4eef..bbf4a18 100755 --- a/Source/WebKit2/UIProcess/API/efl/tizen/DragHandle.cpp +++ b/Source/WebKit2/UIProcess/API/efl/tizen/DragHandle.cpp @@ -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(eventInfo); DragHandle* handle = static_cast(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(eventInfo); DragHandle* handle = static_cast(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); -- 2.7.4