, m_selectedHandle(0)
#endif
, m_handleMovingDirection(HandleMovingDirectionNormal)
+ , m_isSelectionInScrollingMode(false)
{
ASSERT(viewWidget);
m_viewImpl->page()->hideContextMenu();
}
+void TextSelection::scrollContentWithSelectionIfRequired(const IntPoint& evasPoint)
+{
+ EditorState editorState = m_viewImpl->page()->editorState();
+ if (editorState.isContentEditable)
+ return;
+
+ setSelectionScrollingStatus(true);
+ IntRect unscaledVisibleContentRect = m_viewImpl->pageClient->visibleContentRect();
+ const int scrollClipValue = 50;
+ if (evasPoint.y() >= (unscaledVisibleContentRect.height() - scrollClipValue))
+ m_viewImpl->pageClient->scrollBy(IntSize(0, m_rightHandle->getHandleRect().height()));
+ else if (evasPoint.y() <= scrollClipValue) {
+ IntSize scrollSize(0, m_rightHandle->getHandleRect().height());
+ scrollSize.scale(-1);
+ m_viewImpl->pageClient->scrollBy(scrollSize);
+ }
+
+ if (evasPoint.x() >= (unscaledVisibleContentRect.width() - scrollClipValue))
+ m_viewImpl->pageClient->scrollBy(IntSize(m_rightHandle->getHandleRect().width(),0));
+ else if (evasPoint.x() <= scrollClipValue) {
+ IntSize scrollSize(m_rightHandle->getHandleRect().width(), 0);
+ scrollSize.scale(-1);
+ m_viewImpl->pageClient->scrollBy(scrollSize);
+ }
+ setSelectionScrollingStatus(false);
+}
+
void TextSelection::setLeftSelectionToEvasPoint(const IntPoint& evasPoint)
{
+ scrollContentWithSelectionIfRequired(evasPoint);
int result = m_viewImpl->page()->setLeftSelection(m_viewImpl->transformFromScene().mapPoint(evasPoint), m_handleMovingDirection);
if (result)
m_handleMovingDirection = result;
void TextSelection::setRightSelectionToEvasPoint(const IntPoint& evasPoint)
{
+ scrollContentWithSelectionIfRequired(evasPoint);
int result = m_viewImpl->page()->setRightSelection(m_viewImpl->transformFromScene().mapPoint(evasPoint), m_handleMovingDirection);
if (result)
m_handleMovingDirection = result;
void TextSelection::updateHandlesAndContextMenu(bool isShow, bool isScrolling)
{
+ if (getSelectionScrollingStatus())
+ return;
+
if (isTextSelectionDowned() && !isScrolling) {
showMagnifier();
return;
static Eina_Bool showTimerCallback(void* data);
void showHandlesAndContextMenu();
+ void scrollContentWithSelectionIfRequired(const WebCore::IntPoint& evasPoint);
+ int getSelectionScrollingStatus() { return m_isSelectionInScrollingMode; }
+ void setSelectionScrollingStatus(bool status) { m_isSelectionInScrollingMode = status; }
#if ENABLE(TIZEN_WEBKIT2_GET_TEXT_STYLE_FOR_SELECTION)
void informTextStyleState();
TextSelectionHandle* m_selectedHandle;
#endif
int m_handleMovingDirection;
+ bool m_isSelectionInScrollingMode;
};
} // namespace WebKit