Fix the position of the magnifier for text selection
authorTaeyun An <ty.an@samsung.com>
Wed, 12 Jun 2013 14:30:00 +0000 (23:30 +0900)
committerTaeyun An <ty.an@samsung.com>
Wed, 12 Jun 2013 14:39:51 +0000 (23:39 +0900)
[Title] Fix the position of the magnifier for text selection
[Issue#] P130610-4150
[Problem] the magnifier for text selection was displayed at the invalid postion
          in the email viewer in landscape mode
[Cause] the position of the view was calculcated
[Solution] add the position of the view when calculcating the position of the magnifier

Change-Id: Ib426df956b3b1c0c7939843fc19ebee82a8f5a6f

Source/WebKit2/UIProcess/API/efl/tizen/TextSelectionMagnifier.cpp

index 7d98fa1..2d28d03 100755 (executable)
@@ -141,20 +141,20 @@ static int s_defaultEdjeHeight = 177;
 
 void TextSelectionMagnifier::move(const IntPoint& point)
 {
-    int viewWidth, viewHeight;
-    evas_object_geometry_get(m_viewImpl->view(), 0, 0, &viewWidth, &viewHeight);
+    int viewX, viewY, viewWidth, viewHeight;
+    evas_object_geometry_get(m_viewImpl->view(), &viewX, &viewY, &viewWidth, &viewHeight);
 
     int xPosition = point.x();
-    if (xPosition < (m_width / 2))
-        xPosition = m_width / 2 + s_magnifierMargin;
-    if (xPosition > viewWidth - (m_width / 2))
-        xPosition = viewWidth - (m_width / 2) - s_magnifierMargin;
+    if (xPosition < viewX + (m_width / 2))
+        xPosition = viewX + m_width / 2 + s_magnifierMargin;
+    if (xPosition > viewX + viewWidth - (m_width / 2))
+        xPosition = viewX + viewWidth - (m_width / 2) - s_magnifierMargin;
 
     int yPosition = point.y() - ((float)s_magnifierOffsetY * ((float)m_edjeHeight / s_defaultEdjeHeight));
-    if (yPosition < (m_height / 2))
-        yPosition = m_height / 2;
-    if (yPosition > viewHeight - (m_height / 2))
-        yPosition = viewHeight - (m_height / 2);
+    if (yPosition < viewY)
+        yPosition = viewY;
+    if (yPosition > viewY + viewHeight)
+        yPosition = viewY + viewHeight;
 
     evas_object_move(m_magnifier, xPosition, yPosition);
 }