Chromium Code Reviews| Index: third_party/WebKit/Source/platform/WebMouseWheelEvent.cpp |
| diff --git a/third_party/WebKit/Source/platform/WebMouseWheelEvent.cpp b/third_party/WebKit/Source/platform/WebMouseWheelEvent.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4bbd079068ba6c38cc10170982276aa1dd3507ac |
| --- /dev/null |
| +++ b/third_party/WebKit/Source/platform/WebMouseWheelEvent.cpp |
| @@ -0,0 +1,29 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "public/platform/WebMouseWheelEvent.h" |
| + |
| +namespace blink { |
| + |
| +float WebMouseWheelEvent::deltaXInRootFrame() const { |
| + return deltaX / m_frameScale; |
| +} |
| + |
| +float WebMouseWheelEvent::deltaYInRootFrame() const { |
| + return deltaY / m_frameScale; |
| +} |
| + |
| +WebMouseWheelEvent WebMouseWheelEvent::flattenTransform() const { |
| + WebMouseWheelEvent result = *this; |
| + result.deltaX /= result.m_frameScale; |
| + 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
|
| + result.x = (result.x / result.m_frameScale) + result.m_frameTranslate.x; |
| + result.y = (result.y / result.m_frameScale) + result.m_frameTranslate.y; |
| + result.m_frameTranslate.x = 0; |
| + result.m_frameTranslate.y = 0; |
| + result.m_frameScale = 1; |
| + return result; |
| +} |
| + |
| +} // namespace blink |