evas_object_smart_callback_call(m_viewImpl->view(), "magnifier,hide", 0);
}
+static int s_magnifierMargin = 10;
+static int s_magnifierOffsetY = 220;
+
void TextSelectionMagnifier::move(const IntPoint& point)
{
- int viewX, viewY, viewWidth, viewHeight;
- evas_object_geometry_get(m_viewImpl->view(), &viewX, &viewY, &viewWidth, &viewHeight);
-
- int magnfierX, magnfierY, magnfierWidth, magnfierHeight;
- evas_object_geometry_get(m_magnifier, &magnfierX, &magnfierY, &magnfierWidth, &magnfierHeight);
+ int viewWidth, viewHeight;
+ evas_object_geometry_get(m_viewImpl->view(), 0, 0, &viewWidth, &viewHeight);
int xPosition = point.x();
- if (xPosition < (magnfierWidth / 2))
- xPosition = magnfierWidth / 2;
- if (xPosition > viewWidth - (magnfierWidth / 2))
- xPosition = viewWidth - (magnfierWidth / 2);
-
- int yPosition = point.y() - 230;
- if (yPosition < (magnfierHeight / 2))
- yPosition = magnfierHeight / 2;
- if (yPosition > viewHeight - (magnfierHeight / 2))
- yPosition = viewHeight - (magnfierHeight / 2);
+ if (xPosition < (m_width / 2))
+ xPosition = m_width / 2 + s_magnifierMargin;
+ if (xPosition > viewWidth - (m_width / 2))
+ xPosition = viewWidth - (m_width / 2) - s_magnifierMargin;
+
+ int yPosition = point.y() - s_magnifierOffsetY;
+ if (yPosition < (m_height / 2))
+ yPosition = m_height / 2;
+ if (yPosition > viewHeight - (m_height / 2))
+ yPosition = viewHeight - (m_height / 2);
evas_object_move(m_magnifier, xPosition, yPosition);
}