Title: [91183] trunk/Source/WebKit2
Revision
91183
Author
[email protected]
Date
2011-07-18 06:43:55 -0700 (Mon, 18 Jul 2011)

Log Message

[Qt] Consider QTouchWebPage's transform when scrolling the viewport.
https://bugs.webkit.org/show_bug.cgi?id=64541

Reviewed by Benjamin Poulain.

Currently the scroll deltas are given to moveBy in page coordinates
which doesn't match when the page view is scalled.
This patch gives the scroll delta to the viewport in it's own coordinates.

* UIProcess/qt/TouchViewInterface.cpp:
(WebKit::TouchViewInterface::panGestureRequestScroll):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (91182 => 91183)


--- trunk/Source/WebKit2/ChangeLog	2011-07-18 13:43:43 UTC (rev 91182)
+++ trunk/Source/WebKit2/ChangeLog	2011-07-18 13:43:55 UTC (rev 91183)
@@ -1,5 +1,19 @@
 2011-07-15  Jocelyn Turcotte  <[email protected]>
 
+        [Qt] Consider QTouchWebPage's transform when scrolling the viewport.
+        https://bugs.webkit.org/show_bug.cgi?id=64541
+
+        Reviewed by Benjamin Poulain.
+
+        Currently the scroll deltas are given to moveBy in page coordinates
+        which doesn't match when the page view is scalled.
+        This patch gives the scroll delta to the viewport in it's own coordinates.
+
+        * UIProcess/qt/TouchViewInterface.cpp:
+        (WebKit::TouchViewInterface::panGestureRequestScroll):
+
+2011-07-15  Jocelyn Turcotte  <[email protected]>
+
         [Qt] Push the new viewport rect to the drawing area after committing the scale.
         https://bugs.webkit.org/show_bug.cgi?id=64597
 

Modified: trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.cpp (91182 => 91183)


--- trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.cpp	2011-07-18 13:43:43 UTC (rev 91182)
+++ trunk/Source/WebKit2/UIProcess/qt/TouchViewInterface.cpp	2011-07-18 13:43:55 UTC (rev 91183)
@@ -45,7 +45,10 @@
 
 void TouchViewInterface::panGestureRequestScroll(qreal deltaX, qreal deltaY)
 {
-    m_viewportView->d->scroll(deltaX, deltaY);
+    // Translate the delta from page to viewport coordinates.
+    QPointF destInViewportCoords = m_viewportView->mapFromItem(m_pageView, m_pageView->mapFromParent(m_pageView->pos()) + QPointF(deltaX, deltaY));
+    QPointF offsetInViewportCoords = destInViewportCoords - m_viewportView->mapFromItem(m_pageView->parentItem(), m_pageView->pos());
+    m_viewportView->d->scroll(offsetInViewportCoords.x(), offsetInViewportCoords.y());
 }
 
 void TouchViewInterface::panGestureEnded()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to