Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: third_party/WebKit/Source/platform/WebTouchEvent.cpp

Issue 2646163002: Remove PlatformTouchEvent/Point and use WebTouchEvent/Point instead (Closed)
Patch Set: Fix nit Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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/WebTouchEvent.h"
6
7 namespace blink {
8
9 WebTouchEvent WebTouchEvent::flattenTransform() const {
10 WebTouchEvent transformedEvent = *this;
11 for (unsigned i = 0; i < touchesLength; ++i) {
12 transformedEvent.touches[i] = touchPointInRootFrame(i);
13 }
14 transformedEvent.m_frameTranslate.x = 0;
15 transformedEvent.m_frameTranslate.y = 0;
16 transformedEvent.m_frameScale = 1;
17
18 return transformedEvent;
19 }
20
21 WebTouchPoint WebTouchEvent::touchPointInRootFrame(unsigned point) const {
22 DCHECK_LT(point, touchesLength);
23 if (point >= touchesLength)
24 return WebTouchPoint();
25
26 WebTouchPoint transformedPoint = touches[point];
27 transformedPoint.radiusX /= m_frameScale;
28 transformedPoint.radiusY /= m_frameScale;
29 transformedPoint.position.x =
30 (transformedPoint.position.x / m_frameScale) + m_frameTranslate.x;
31 transformedPoint.position.y =
32 (transformedPoint.position.y / m_frameScale) + m_frameTranslate.y;
33 return transformedPoint;
34 }
35
36 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/PlatformTouchPoint.h ('k') | third_party/WebKit/Source/web/InspectorOverlay.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698