Chromium Code Reviews| 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 8e297fa165b3b6574d0b8c73e9c0f53c27a206fe..5a72cb65b5052ee96a3c9900837ff63935ede5ad 100644 |
| --- a/third_party/WebKit/Source/platform/WebMouseEvent.cpp |
| +++ b/third_party/WebKit/Source/platform/WebMouseEvent.cpp |
| @@ -17,11 +17,10 @@ WebMouseEvent::WebMouseEvent(WebInputEvent::Type type, |
| : 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) { |
| + clickCount(clickCountParam), |
| + m_positionInWidget(WebFloatPoint(gestureEvent.x, gestureEvent.y)), |
|
dtapuska
2017/03/31 14:04:18
This is odd. Do you require the extra WebFloatPoin
mustaq
2017/03/31 15:50:31
Thanks for the catch, done.
|
| + m_positionInScreen( |
| + WebFloatPoint(gestureEvent.globalX, gestureEvent.globalY)) { |
| setFrameScale(gestureEvent.frameScale()); |
| setFrameTranslate(gestureEvent.frameTranslate()); |
| } |
| @@ -31,8 +30,9 @@ WebFloatPoint WebMouseEvent::movementInRootFrame() const { |
| } |
| WebFloatPoint WebMouseEvent::positionInRootFrame() const { |
| - return WebFloatPoint((x / m_frameScale) + m_frameTranslate.x, |
| - (y / m_frameScale) + m_frameTranslate.y); |
| + return WebFloatPoint( |
| + (m_positionInWidget.x / m_frameScale) + m_frameTranslate.x, |
| + (m_positionInWidget.y / m_frameScale) + m_frameTranslate.y); |
| } |
| WebMouseEvent WebMouseEvent::flattenTransform() const { |
| @@ -42,8 +42,10 @@ WebMouseEvent WebMouseEvent::flattenTransform() const { |
| } |
| void WebMouseEvent::flattenTransformSelf() { |
| - x = (x / m_frameScale) + m_frameTranslate.x; |
| - y = (y / m_frameScale) + m_frameTranslate.y; |
| + m_positionInWidget.x = |
| + floor((m_positionInWidget.x / m_frameScale) + m_frameTranslate.x); |
|
dtapuska
2017/03/31 14:04:18
Can we add a comment why we are taking the floor?
mustaq
2017/03/31 15:50:32
Added a comment in the class header.
|
| + m_positionInWidget.y = |
| + floor((m_positionInWidget.y / m_frameScale) + m_frameTranslate.y); |
| m_frameTranslate.x = 0; |
| m_frameTranslate.y = 0; |
| m_frameScale = 1; |