| Index: third_party/WebKit/Source/platform/WebMouseEvent.cpp
|
| diff --git a/third_party/WebKit/Source/platform/WebMouseEvent.cpp b/third_party/WebKit/Source/platform/WebMouseEvent.cpp
|
| index 4e6e9575f02fe7c06f1faa9072933c13d484ebdd..8e297fa165b3b6574d0b8c73e9c0f53c27a206fe 100644
|
| --- a/third_party/WebKit/Source/platform/WebMouseEvent.cpp
|
| +++ b/third_party/WebKit/Source/platform/WebMouseEvent.cpp
|
| @@ -4,8 +4,28 @@
|
|
|
| #include "public/platform/WebMouseEvent.h"
|
|
|
| +#include "public/platform/WebGestureEvent.h"
|
| +
|
| namespace blink {
|
|
|
| +WebMouseEvent::WebMouseEvent(WebInputEvent::Type type,
|
| + const WebGestureEvent& gestureEvent,
|
| + Button buttonParam,
|
| + int clickCountParam,
|
| + int modifiers,
|
| + double timeStampSeconds)
|
| + : WebInputEvent(sizeof(WebMouseEvent), type, modifiers, timeStampSeconds),
|
| + WebPointerProperties(buttonParam,
|
| + WebPointerProperties::PointerType::Mouse),
|
| + x(gestureEvent.x),
|
| + y(gestureEvent.y),
|
| + globalX(gestureEvent.globalX),
|
| + globalY(gestureEvent.globalY),
|
| + clickCount(clickCountParam) {
|
| + setFrameScale(gestureEvent.frameScale());
|
| + setFrameTranslate(gestureEvent.frameTranslate());
|
| +}
|
| +
|
| WebFloatPoint WebMouseEvent::movementInRootFrame() const {
|
| return WebFloatPoint((movementX / m_frameScale), (movementY / m_frameScale));
|
| }
|
| @@ -15,6 +35,12 @@ WebFloatPoint WebMouseEvent::positionInRootFrame() const {
|
| (y / m_frameScale) + m_frameTranslate.y);
|
| }
|
|
|
| +WebMouseEvent WebMouseEvent::flattenTransform() const {
|
| + WebMouseEvent result = *this;
|
| + result.flattenTransformSelf();
|
| + return result;
|
| +}
|
| +
|
| void WebMouseEvent::flattenTransformSelf() {
|
| x = (x / m_frameScale) + m_frameTranslate.x;
|
| y = (y / m_frameScale) + m_frameTranslate.y;
|
|
|