summaryrefslogtreecommitdiff
path: root/Source/WebKit2/Shared/qt
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-18 14:03:11 +0200
commit8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch)
treecdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/WebKit2/Shared/qt
parent1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff)
downloadqtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Source/WebKit2/Shared/qt')
-rw-r--r--Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp b/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
index 3091d64c9..45fc34ae6 100644
--- a/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
+++ b/Source/WebKit2/Shared/qt/WebEventFactoryQt.cpp
@@ -27,9 +27,11 @@
#include "config.h"
#include "WebEventFactoryQt.h"
#include <QKeyEvent>
+#include <QLineF>
#include <QTransform>
-#include <WebCore/IntPoint.h>
#include <WebCore/FloatPoint.h>
+#include <WebCore/FloatSize.h>
+#include <WebCore/IntPoint.h>
#include <WebCore/PlatformKeyboardEvent.h>
#include <wtf/ASCIICType.h>
#include <wtf/CurrentTime.h>
@@ -149,7 +151,13 @@ WebWheelEvent WebEventFactory::createWebWheelEvent(QWheelEvent* e, const QTransf
deltaX = wheelTicksX * wheelScrollLines * cDefaultQtScrollStep;
deltaY = wheelTicksY * wheelScrollLines * cDefaultQtScrollStep;
- return WebWheelEvent(WebEvent::Wheel, fromItemTransform.map(e->posF()).toPoint(), e->globalPosF().toPoint(), FloatSize(deltaX, deltaY), FloatSize(wheelTicksX, wheelTicksY), granularity, modifiers, timestamp);
+ // Transform the position and the pixel scrolling distance.
+ QLineF transformedScroll = fromItemTransform.map(QLineF(e->posF(), e->posF() + QPointF(deltaX, deltaY)));
+ IntPoint transformedPoint = transformedScroll.p1().toPoint();
+ IntPoint globalPoint = e->globalPosF().toPoint();
+ FloatSize transformedDelta(transformedScroll.dx(), transformedScroll.dy());
+ FloatSize wheelTicks(wheelTicksX, wheelTicksY);
+ return WebWheelEvent(WebEvent::Wheel, transformedPoint, globalPoint, transformedDelta, wheelTicks, granularity, modifiers, timestamp);
}
WebKeyboardEvent WebEventFactory::createWebKeyboardEvent(QKeyEvent* event)