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

Unified Diff: ui/events/gesture_detection/gesture_config_helper_aura.cc

Issue 282593002: Reland Unified Gesture Recognizer for Aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase again... Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/gesture_detection/motion_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/gesture_detection/gesture_config_helper_aura.cc
diff --git a/ui/events/gesture_detection/gesture_config_helper_aura.cc b/ui/events/gesture_detection/gesture_config_helper_aura.cc
index 6824959a0fd62f50c418a85df75b3ef76947b6a2..9c6603f166f02300b1303985b2fa4a1eb18985fb 100644
--- a/ui/events/gesture_detection/gesture_config_helper_aura.cc
+++ b/ui/events/gesture_detection/gesture_config_helper_aura.cc
@@ -2,8 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+// MSVC++ requires this to be set before any other includes to get M_PI.
+#define _USE_MATH_DEFINES
+
#include "ui/events/gesture_detection/gesture_config_helper.h"
+#include <cmath>
+
#include "ui/events/gestures/gesture_configuration.h"
#include "ui/gfx/screen.h"
@@ -25,12 +30,12 @@ GestureDetector::Config DefaultGestureDetectorConfig() {
GestureConfiguration::max_distance_between_taps_for_double_tap();
config.minimum_fling_velocity =
GestureConfiguration::min_scroll_velocity();
- config.maximum_fling_velocity =
- GestureConfiguration::fling_velocity_cap();
+ config.maximum_fling_velocity = GestureConfiguration::fling_velocity_cap();
config.swipe_enabled = true;
config.minimum_swipe_velocity = GestureConfiguration::min_swipe_speed();
config.maximum_swipe_deviation_angle =
- atan2(1.f, GestureConfiguration::max_swipe_deviation_ratio());
+ atan2(1.f, GestureConfiguration::max_swipe_deviation_ratio()) * 180.0f /
+ static_cast<float>(M_PI);
config.two_finger_tap_enabled = true;
config.two_finger_tap_max_separation =
GestureConfiguration::max_distance_for_two_finger_tap_in_pixels();
@@ -46,8 +51,7 @@ ScaleGestureDetector::Config DefaultScaleGestureDetectorConfig() {
config.gesture_detector_config = DefaultGestureDetectorConfig();
config.min_scaling_touch_major = GestureConfiguration::default_radius() * 2;
- config.min_scaling_span =
- GestureConfiguration::min_distance_for_pinch_scroll_in_pixels();
+ config.min_scaling_span = GestureConfiguration::min_scaling_span_in_pixels();
return config;
}
« no previous file with comments | « ui/events/events.gyp ('k') | ui/events/gesture_detection/motion_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698