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

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

Issue 251543003: Unified Gesture Recognizer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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 420b7fa983f7f057c84132f57ea444786a354e54..836d04b954d30357716f873786ac993b7572e7bf 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"
@@ -30,7 +35,8 @@ GestureDetector::Config DefaultGestureDetectorConfig() {
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);
return config;
}
@@ -40,8 +46,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