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

Side by Side Diff: ui/events/gesture_detection/gesture_provider_config_helper.cc

Issue 1778063002: Eliminate pinch drift by removing touch radius from span calculation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shrink minimum scale span. Created 4 years, 9 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/gesture_detection/gesture_provider_config_helper.h" 5 #include "ui/events/gesture_detection/gesture_provider_config_helper.h"
6 6
7 #include "ui/events/gesture_detection/gesture_configuration.h" 7 #include "ui/events/gesture_detection/gesture_configuration.h"
8 #include "ui/gfx/screen.h" 8 #include "ui/gfx/screen.h"
9 9
10 namespace ui { 10 namespace ui {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 gesture_config.max_touch_down_duration_for_click_in_ms()); 43 gesture_config.max_touch_down_duration_for_click_in_ms());
44 config.single_tap_repeat_interval = gesture_config.max_tap_count(); 44 config.single_tap_repeat_interval = gesture_config.max_tap_count();
45 config.velocity_tracker_strategy = gesture_config.velocity_tracker_strategy(); 45 config.velocity_tracker_strategy = gesture_config.velocity_tracker_strategy();
46 return config; 46 return config;
47 } 47 }
48 48
49 ScaleGestureDetector::Config BuildScaleGestureDetectorConfig( 49 ScaleGestureDetector::Config BuildScaleGestureDetectorConfig(
50 const GestureConfiguration& gesture_config) { 50 const GestureConfiguration& gesture_config) {
51 ScaleGestureDetector::Config config; 51 ScaleGestureDetector::Config config;
52 config.span_slop = gesture_config.span_slop(); 52 config.span_slop = gesture_config.span_slop();
53 config.min_scaling_touch_major = gesture_config.min_scaling_touch_major();
54 config.min_scaling_span = gesture_config.min_scaling_span_in_pixels(); 53 config.min_scaling_span = gesture_config.min_scaling_span_in_pixels();
55 config.min_pinch_update_span_delta = 54 config.min_pinch_update_span_delta =
56 gesture_config.min_pinch_update_span_delta(); 55 gesture_config.min_pinch_update_span_delta();
57 config.stylus_scale_enabled = gesture_config.stylus_scale_enabled(); 56 config.stylus_scale_enabled = gesture_config.stylus_scale_enabled();
58 return config; 57 return config;
59 } 58 }
60 59
61 GestureProvider::Config BuildGestureProviderConfig( 60 GestureProvider::Config BuildGestureProviderConfig(
62 const GestureConfiguration& gesture_config) { 61 const GestureConfiguration& gesture_config) {
63 GestureProvider::Config config; 62 GestureProvider::Config config;
(...skipping 28 matching lines...) Expand all
92 91
93 gfx::Screen* screen = gfx::Screen::GetScreen(); 92 gfx::Screen* screen = gfx::Screen::GetScreen();
94 // |screen| is sometimes NULL during tests. 93 // |screen| is sometimes NULL during tests.
95 if (screen) 94 if (screen)
96 config.display = screen->GetPrimaryDisplay(); 95 config.display = screen->GetPrimaryDisplay();
97 96
98 return config; 97 return config;
99 } 98 }
100 99
101 } // namespace ui 100 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_configuration_aura.cc ('k') | ui/events/gesture_detection/scale_gesture_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698