Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "public/platform/WebMouseWheelEvent.h" | |
| 6 | |
| 7 namespace blink { | |
| 8 | |
| 9 float WebMouseWheelEvent::deltaXInRootFrame() const { | |
| 10 return deltaX / m_frameScale; | |
| 11 } | |
| 12 | |
| 13 float WebMouseWheelEvent::deltaYInRootFrame() const { | |
| 14 return deltaY / m_frameScale; | |
| 15 } | |
| 16 | |
| 17 WebMouseWheelEvent WebMouseWheelEvent::flattenTransform() const { | |
| 18 WebMouseWheelEvent result = *this; | |
| 19 result.deltaX /= result.m_frameScale; | |
| 20 result.deltaY /= result.m_frameScale; | |
|
majidvp
2016/12/20 17:30:14
I think this should also flatten movement{X,Y}.
P
dtapuska
2017/01/03 20:19:14
I've added a FlattenTransformSelf on mouse event t
| |
| 21 result.x = (result.x / result.m_frameScale) + result.m_frameTranslate.x; | |
| 22 result.y = (result.y / result.m_frameScale) + result.m_frameTranslate.y; | |
| 23 result.m_frameTranslate.x = 0; | |
| 24 result.m_frameTranslate.y = 0; | |
| 25 result.m_frameScale = 1; | |
| 26 return result; | |
| 27 } | |
| 28 | |
| 29 } // namespace blink | |
| OLD | NEW |