Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1024)

Unified Diff: third_party/WebKit/Source/core/events/PointerEventFactory.cpp

Issue 2624783002: Fix movementX/Y attributes for touch pointer events (Closed)
Patch Set: Wrap ForwardTouchEventWithLatencyInfo to always reset points Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/events/PointerEventFactory.cpp
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
index f2840ccc5a70b95b13e2569525b794371f80082e..e7cfb468afc000a5bb8c19fa97f0c1081c390d35 100644
--- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
+++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
@@ -118,6 +118,11 @@ void updateTouchPointerEventInit(const WebTouchPoint& touchPoint,
pointerEventInit->setClientX(clientPoint.x());
pointerEventInit->setClientY(clientPoint.y());
+ if (touchPoint.state == WebTouchPoint::StateMoved) {
+ pointerEventInit->setMovementX(touchPoint.movementX);
+ pointerEventInit->setMovementY(touchPoint.movementY);
+ }
+
FloatSize pointRadius =
FloatSize(touchPoint.radiusX, touchPoint.radiusY).scaledBy(scaleFactor);
pointerEventInit->setWidth(pointRadius.width());
@@ -164,6 +169,10 @@ void updateMousePointerEventInit(const WebMouseEvent& mouseEvent,
pointerEventInit->setTiltY(mouseEvent.tiltY);
pointerEventInit->setTangentialPressure(mouseEvent.tangentialPressure);
pointerEventInit->setTwist(mouseEvent.twist);
+
+ IntPoint movement = flooredIntPoint(mouseEvent.movementInRootFrame());
+ pointerEventInit->setMovementX(movement.x());
+ pointerEventInit->setMovementY(movement.y());
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698