[Qt][WK2] Touch/Mouse events are delivered with wrong coordinates.

https://bugs.webkit.org/show_bug.cgi?id=72604

When using the QtViewportInterationEngine for zooming/panning,
no additional scroll offset should be applied to input events
by the ScrollView.

This patch is based on work by Andreas Kling.

Reviewed by Kenneth Rohde Christiansen.

* platform/ScrollView.cpp:
(WebCore::ScrollView::windowToContents):
(WebCore::ScrollView::contentsToWindow):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100612 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 99905016
2011-11-17 Zeno Albisser <zeno@webkit.org>
[Qt][WK2] Touch/Mouse events are delivered with wrong coordinates.
https://bugs.webkit.org/show_bug.cgi?id=72604
When using the QtViewportInterationEngine for zooming/panning,
no additional scroll offset should be applied to input events
by the ScrollView.
This patch is based on work by Andreas Kling.
Reviewed by Kenneth Rohde Christiansen.
* platform/ScrollView.cpp:
(WebCore::ScrollView::windowToContents):
(WebCore::ScrollView::contentsToWindow):
2011-11-17 Ben Murdoch <benm@google.com>
Unreviewed build fix.
......@@ -712,18 +712,27 @@ IntRect ScrollView::contentsToRootView(const IntRect& contentsRect) const
IntPoint ScrollView::windowToContents(const IntPoint& windowPoint) const
{
if (delegatesScrolling())
return convertFromContainingWindow(windowPoint);
IntPoint viewPoint = convertFromContainingWindow(windowPoint);
return viewPoint + scrollOffset();
}
IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const
{
if (delegatesScrolling())
return convertToContainingWindow(contentsPoint);
IntPoint viewPoint = contentsPoint - scrollOffset();
return convertToContainingWindow(viewPoint);
}
IntRect ScrollView::windowToContents(const IntRect& windowRect) const
{
if (delegatesScrolling())
return convertFromContainingWindow(windowRect);
IntRect viewRect = convertFromContainingWindow(windowRect);
viewRect.move(scrollOffset());
return viewRect;
......@@ -731,6 +740,9 @@ IntRect ScrollView::windowToContents(const IntRect& windowRect) const
IntRect ScrollView::contentsToWindow(const IntRect& contentsRect) const
{
if (delegatesScrolling())
return convertToContainingWindow(contentsRect);
IntRect viewRect = contentsRect;
viewRect.move(-scrollOffset());
return convertToContainingWindow(viewRect);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment