OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "public/platform/WebInputEvent.h" | 5 #include "public/platform/WebMouseEvent.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 WebFloatPoint WebMouseEvent::movementInRootFrame() const { | 9 WebFloatPoint WebMouseEvent::movementInRootFrame() const { |
10 return WebFloatPoint((movementX / m_frameScale), (movementY / m_frameScale)); | 10 return WebFloatPoint((movementX / m_frameScale), (movementY / m_frameScale)); |
11 } | 11 } |
12 | 12 |
13 WebFloatPoint WebMouseEvent::positionInRootFrame() const { | 13 WebFloatPoint WebMouseEvent::positionInRootFrame() const { |
14 return WebFloatPoint((x / m_frameScale) + m_frameTranslate.x, | 14 return WebFloatPoint((x / m_frameScale) + m_frameTranslate.x, |
15 (y / m_frameScale) + m_frameTranslate.y); | 15 (y / m_frameScale) + m_frameTranslate.y); |
16 } | 16 } |
17 | 17 |
18 void WebMouseEvent::flattenTransformSelf() { | 18 void WebMouseEvent::flattenTransformSelf() { |
19 x = (x / m_frameScale) + m_frameTranslate.x; | 19 x = (x / m_frameScale) + m_frameTranslate.x; |
20 y = (y / m_frameScale) + m_frameTranslate.y; | 20 y = (y / m_frameScale) + m_frameTranslate.y; |
21 m_frameTranslate.x = 0; | 21 m_frameTranslate.x = 0; |
22 m_frameTranslate.y = 0; | 22 m_frameTranslate.y = 0; |
23 m_frameScale = 1; | 23 m_frameScale = 1; |
24 } | 24 } |
25 | 25 |
26 } // namespace blink | 26 } // namespace blink |
OLD | NEW |