Contents of Magnifier are getting truncated
authorprathmesh.m <prathmesh.m@samsung.com>
Fri, 5 Jul 2013 08:50:43 +0000 (14:20 +0530)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Tue, 9 Jul 2013 06:21:00 +0000 (06:21 +0000)
[Title] Contents of Magnifier are getting truncated
[Issue#] N_SE-44325
[Problem] If the touch point is at the top or at the bottom
   end during extending the selection then the contents in
   the magnifier are not visible correctly
[Cause] The rect sent to get the snapshot of the page is
   above the visable area so text appears to be truncated
[Solution] Added check if the touch point is very near to
   top or bottom then adjust the content rect

Change-Id: I248d7b0886347dc80f6ad81e2a17d218228803e3

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

index 2d28d03..caf11cd 100755 (executable)
@@ -58,6 +58,7 @@ TextSelectionMagnifier::~TextSelectionMagnifier()
 
 static float s_widtheOffset = 32;
 static float s_heightOffset = 60;
+static int s_magnifierMargin = 10;
 
 void TextSelectionMagnifier::update(const IntPoint& point)
 {
@@ -93,6 +94,13 @@ void TextSelectionMagnifier::update(const IntPoint& point)
     if (overSize > 0)
         rect.setY(rect.y() - overSize);
 
+    // Check if the touch point is very near to top or bottom.
+    // Adjust the rect to get the proper image in magnifier
+    if ((rect.y() < m_height/2) && (rect.y() > s_magnifierMargin))
+        rect.setY(rect.y() - (s_magnifierMargin));
+    if (rect.y() > (viewHeight - m_height))
+        rect.setY(rect.y() + (s_magnifierMargin));
+
     RefPtr<WebImage> webImage = m_viewImpl->page()->createSnapshot(rect, zoomLevel);
     if (!webImage || !webImage->bitmap())
         return;
@@ -135,7 +143,6 @@ void TextSelectionMagnifier::hide()
     evas_object_smart_callback_call(m_viewImpl->view(), "magnifier,hide", 0);
 }
 
-static int s_magnifierMargin = 10;
 static int s_magnifierOffsetY = 220;
 static int s_defaultEdjeHeight = 177;